Global Design Tokens

Defined in :root — available everywhere, inherited by all components.

Spacing

Five named sizes. The p, px, m, etc. style props resolve these tokens automatically.

--dv-spacing-xs
0.5rem8pxCompact gaps, tight padding
--dv-spacing-sm
0.75rem12pxSmall gaps, input padding
--dv-spacing-md
1rem16pxDefault component padding
--dv-spacing-lg
1.5rem24pxSection spacing, card padding
--dv-spacing-xl
2rem32pxLarge sections, page margins
/* Override globally or scope to a section */
:root          { --dv-spacing-md: 0.875rem; }
.compact-ui    { --dv-spacing-md: 0.75rem;  }

Radius

Override --dv-radius-default to restyle border-radius across all components at once — or target individual sizes for fine control.

--dv-radius-xs
0.125rem2pxSubtle rounding — code, labels
--dv-radius-sm
0.25rem4pxButtons, inputs
--dv-radius-md
0.5rem8pxCards, modals, panels
--dv-radius-lg
1rem16pxPill buttons, large cards
--dv-radius-xl
2rem32pxDecorative, fully rounded
--dv-radius-default
0.25rem4pxComponent fallback (= sm) — override to restyle all at once
/* Square corners everywhere */
:root { --dv-radius-default: 0; }

Typography

Font sizes

Five sizes aligned with the spacing scale. Used by the fz style prop.

--dv-font-size-xsAa0.75rem12pxLabels, captions, badges
--dv-font-size-smAa0.875rem14pxSecondary text, table cells
--dv-font-size-mdAa1rem16pxBody text (default)
--dv-font-size-lgAa1.125rem18pxEmphasized body, lead text
--dv-font-size-xlAa1.25rem20pxSubheadings, card titles

Line heights

TokenValueUsed for
--dv-line-height-xs1.4Compact text, single-line elements
--dv-line-height-sm1.45Dense text, tooltips
--dv-line-height-md1.55Body text (default)
--dv-line-height-lg1.6Comfortable reading
--dv-line-height-xl1.65Open, airy long-form text

Font families

TokenDefault
--dv-font-family-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif
--dv-font-family-monospaceui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace
--dv-font-family-headingsvar(--dv-font-family) — override to use a display typeface
--dv-heading-font-weight700

Heading scale

Each level exposes -font-size, -font-weight, and -line-height tokens consumed by the Title component.

H1--dv-h1-font-size2.125rem / lh 1.3
H2--dv-h2-font-size1.625rem / lh 1.35
H3--dv-h3-font-size1.375rem / lh 1.4
H4--dv-h4-font-size1.125rem / lh 1.45
H5--dv-h5-font-size1rem / lh 1.5
H6--dv-h6-font-size0.875rem / lh 1.5

Shadows

Decorative named shadows — same in light and dark mode. For depth-based shadows tied to component layer, see Elevation.

TokenVisualUsed for
--dv-shadow-xs
Hairline ambient
--dv-shadow-sm
Small spread, subtle ambient base
--dv-shadow-md
Medium spread, floating feel
--dv-shadow-lg
Large spread, soft and diffuse
--dv-shadow-xl
Extra-large spread, maximum decorative depth

Elevation

Six depth levels (0–5) that adapt between light and dark mode. See Elevation for the full visual reference.

TokenLightDarkUsed by
--dv-elevation-0nonenoneFlat — body, inline content
--dv-elevation-10 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.1)0 1px 3px rgba(0,0,0,.3)Buttons (rest), chips
--dv-elevation-20 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06)0 4px 5px rgba(0,0,0,.35)Buttons (hover), cards
--dv-elevation-30 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05)0 6px 6px rgba(0,0,0,.4)Dropdowns, notifications
--dv-elevation-40 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04)0 8px 7px rgba(0,0,0,.45)Modal, Drawer
--dv-elevation-50 25px 50px rgba(0,0,0,.25)0 10px 8px rgba(0,0,0,.5)Menus, context menus

Z-index scale

Seven named layers. Override a single token to resolve stacking conflicts — no need to dig into component internals.

--dv-z-raised1Hover borders, indicator badges, timeline bullets, slider thumbs
--dv-z-navbar100AppShell fixed header, navbar, footer (base; sections use +1 / +2)
--dv-z-overlay200Overlay component — full-area dimming backdrops
--dv-z-modal300Modal, Drawer
--dv-z-popover400Menu, Select, ColorSchemePicker compact panel
--dv-z-tooltip500Tooltip
--dv-z-notification600Toast, Notification
/* Shift the entire popover/modal layer up to avoid a third-party conflict */
:root {
  --dv-z-modal:   1300;
  --dv-z-popover: 1400;
  --dv-z-tooltip: 1500;
}

Surface layers

Six tinted backgrounds that reinforce depth in dark mode without relying on shadow contrast. See Elevation for the visual reference.

TokenLightDarkUsed for
--dv-surface-0var(--dv-color-body)#1a1b1ePage background
--dv-surface-1#f9f9f9#22232a (+ primary tint)Sidebar, nav, primary panels
--dv-surface-2#f4f4f4#252730 (+ primary tint)Cards, inputs, secondary panels
--dv-surface-3#f0f0f0#282b35 (+ primary tint)Modal / drawer backgrounds
--dv-surface-4#ececec#292c37 (+ primary tint)Floating panels
--dv-surface-5#e8e8e8#2b2f3b (+ primary tint)Tooltips, top-most overlays

Semantic colors

High-level color aliases for body, text, borders, and surfaces. These switch automatically between light and dark mode. Override them to retheme the entire UI without touching individual palette values.

TokenLightDarkUsed for
--dv-color-body#fff#1a1b1ePage background
--dv-color-surfacegray-0 (#f8f9fa)#25262bPanel / sidebar background
--dv-color-textgray-9 (#212529)#c1c2c5Primary text
--dv-color-bordergray-3 (#dee2e6)#373a40Dividers, input borders
--dv-color-dimmedgray-6 (#868e96)gray-5Secondary / muted text
--dv-color-white#fff#fffAlways white — icon fills, etc.
--dv-color-black#1c1c1c#1c1c1cAlways near-black
--dv-color-bright#000#fffHighest-contrast foreground
--dv-color-default#fff#25262bDefault-variant background
--dv-color-default-hovergray-0#2c2e33Default-variant hover background
--dv-color-default-colorgray-9#c1c2c5Default-variant text color
--dv-color-default-bordergray-4 (#ced4da)#373a40Default-variant border

State colors

Semantic aliases for validation and feedback states. They resolve to named-color filled tokens so they automatically adopt the correct shade for light/dark mode.

TokenDefault valueUsed for
--dv-color-errorvar(--dv-color-red-filled)Error states, destructive actions
--dv-color-successvar(--dv-color-green-filled)Success states, confirmations
--dv-color-warningvar(--dv-color-yellow-filled)Warning states, caution
--dv-color-infovar(--dv-color-blue-filled)Informational messages
/* Remap state colors to any named palette */
:root {
  --dv-color-error:   var(--dv-color-crimson-filled);
  --dv-color-success: var(--dv-color-teal-filled);
}

Focus ring

A single token controls keyboard focus outlines across all interactive components. Override it to restyle focus states everywhere at once.

TokenDefault value
--dv-focus-ring0 0 0 0.1875rem color-mix(in srgb, var(--dv-color-primary-filled) 35%, transparent)
/* Solid 2px focus ring instead of the default glow */
:root {
  --dv-focus-ring: 0 0 0 2px var(--dv-color-primary-filled);
}

Primary color

The primary color is an alias layer — 9 tokens that point at whatever named color you designate as your brand color. Defaults to blue. Override all 9 to switch the accent color of every component at once.

TokenDefaultUsed for
--dv-color-primary-filledvar(--dv-color-blue-filled)Primary filled background
--dv-color-primary-filled-hovervar(--dv-color-blue-filled-hover)Hover state of filled
--dv-color-primary-filled-colorvar(--dv-color-blue-filled-color)Text on filled background
--dv-color-primary-lightvar(--dv-color-blue-light)Light variant background
--dv-color-primary-light-hovervar(--dv-color-blue-light-hover)Hover state of light
--dv-color-primary-light-colorvar(--dv-color-blue-light-color)Text on light background
--dv-color-primary-outlinevar(--dv-color-blue-outline)Outline variant border color
--dv-color-primary-outline-hovervar(--dv-color-blue-outline-hover)Hover background of outline
--dv-color-primary-outline-colorvar(--dv-color-blue-outline-color)Text in outline variant
/* Switch primary color to violet */
:root {
  --dv-color-primary-filled:        var(--dv-color-violet-filled);
  --dv-color-primary-filled-hover:  var(--dv-color-violet-filled-hover);
  --dv-color-primary-filled-color:  var(--dv-color-violet-filled-color);
  --dv-color-primary-light:         var(--dv-color-violet-light);
  --dv-color-primary-light-hover:   var(--dv-color-violet-light-hover);
  --dv-color-primary-light-color:   var(--dv-color-violet-light-color);
  --dv-color-primary-outline:       var(--dv-color-violet-outline);
  --dv-color-primary-outline-hover: var(--dv-color-violet-outline-hover);
  --dv-color-primary-outline-color: var(--dv-color-violet-outline-color);
}

Named color variants

Every named color in the palette also gets three variant token sets — filled, light, and outline — used by the color prop on Button, Badge, Alert, and similar components. See Color Palette and Colors for visual references.

Token patternDescription
--dv-color-{name}-filledSolid fill background
--dv-color-{name}-filled-hoverSolid fill hover background
--dv-color-{name}-filled-colorText on solid fill
--dv-color-{name}-lightTranslucent tint background
--dv-color-{name}-light-hoverTint hover background
--dv-color-{name}-light-colorText on tint background
--dv-color-{name}-outlineOutline border color
--dv-color-{name}-outline-hoverOutline hover background
--dv-color-{name}-outline-colorText in outline variant

Available {name} values: red · crimson · pink · grape · violet · indigo · blue · cyan · teal · green · lime · yellow · orange · gray · dark · white · black · primary

Raw palette shades (--dv-color-{name}-{0–9}) are documented on the Color Palette page.

Motion

Duration and easing tokens consumed by all component transitions and animations. See Motion for interactive previews.

TokenValueUsed for
--dv-motion-duration-instant50msFocus rings, micro-feedback
--dv-motion-duration-fast100msHover states, border-color, focus
--dv-motion-duration-normal200msStandard transitions — buttons, tabs
--dv-motion-duration-slow400msStructural movement — burger, progress
--dv-motion-duration-deliberate700msEmphasis, large orchestrated shifts
--dv-motion-ease-standardcubic-bezier(0.4, 0, 0.2, 1)Default — balanced in/out
--dv-motion-ease-entercubic-bezier(0, 0, 0.2, 1)Elements entering (decelerates to stop)
--dv-motion-ease-exitcubic-bezier(0.4, 0, 1, 1)Elements leaving (accelerates away)
--dv-motion-ease-springlinear(…)Modals, drawers — overshoots and settles

Component Override Variables

Each component exposes CSS custom properties on its root element. Set them on the component itself, a parent container, or :root to customise behaviour without writing new selectors.

/* Three ways to override a component variable */

/* 1. On a specific instance via the style prop */
<Slider style="--dv-slider-color: var(--dv-color-green-filled);" />

/* 2. Scoped to a parent container */
.settings-panel { --dv-input-radius: 0; }

/* 3. Globally in :root */
:root { --dv-tooltip-bg: var(--dv-color-violet-filled); }

AppShell

TokenDefaultControls
--dv-shell-z-indexvar(--dv-z-navbar)Base z-index for all fixed shell sections
--dv-shell-paddingvar(--dv-spacing-md)Inner padding of the main content area
--dv-shell-transitionvar(--dv-motion-duration-normal)Slide duration for navbar / aside open/close
--dv-shell-header-height0px (set by component)Fixed header height (managed via props)
--dv-shell-footer-height0px (set by component)Fixed footer height (managed via props)
--dv-shell-navbar-width0px (set by component)Navbar width (managed via props)
--dv-shell-aside-width0px (set by component)Aside width (managed via props)

AspectRatio

TokenDefaultControls
--dv-ar-ratio1Width-to-height ratio (e.g. 16/9)

BackgroundImage

TokenDefaultControls
--dv-bg-image-urlnoneCSS url() value for the background image
--dv-bg-image-radius0Border radius applied to the image container

Badge

TokenDefaultControls
--dv-badge-bgvar(--dv-color-primary-light)Badge background
--dv-badge-colorvar(--dv-color-primary-light-color)Badge text color
--dv-badge-bd1px solid transparentBadge border

Blockquote

TokenDefaultControls
--dv-bq-bgvar(--dv-color-surface)Blockquote background
--dv-bq-bd4px solid …borderLeft border (color + width)
--dv-bq-radiusvar(--dv-radius-sm)Corner radius
--dv-bq-icon-size1.5remQuote icon size

Burger

TokenDefaultControls
--dv-burger-size30pxOverall button size
--dv-burger-colorcurrentColorLine color
--dv-burger-line-size2pxLine thickness
--dv-burger-transitionvar(--dv-motion-duration-slow)Animation duration for open/close

Checkbox

TokenDefaultControls
--dv-checkbox-sizevar(--dv-checkbox-size-md) = 1.25remCheckbox box size
--dv-checkbox-radiusvar(--dv-radius-sm)Checkbox corner radius
--dv-checkbox-colorvar(--dv-color-primary-filled)Checked fill color
--dv-checkbox-icon-color#fffCheckmark icon color

Code

TokenDefaultControls
--dv-code-bgvar(--dv-color-surface)Background of code blocks

ColorSwatch

TokenDefaultControls
--dv-cs-sizevar(--dv-cs-size-md) = 32pxSwatch width / height
--dv-cs-radius50%Corner radius
--dv-cs-colortransparentFill color (set via color prop)

Drawer

TokenDefaultControls
--dv-drawer-width15rem–50rem (size-dependent)Panel width (side drawers)
--dv-drawer-height12rem–30rem (size-dependent)Panel height (top/bottom drawers)

Fieldset

TokenDefaultControls
--dv-fieldset-radiusvar(--dv-radius-sm)Fieldset border radius

Flex

TokenDefaultControls
--dv-flex-gap0Gap between flex children
--dv-flex-row-gapvar(--dv-flex-gap)Row gap override
--dv-flex-col-gapvar(--dv-flex-gap)Column gap override
--dv-flex-alignstretchalign-items value
--dv-flex-justifyflex-startjustify-content value
--dv-flex-directionrowflex-direction value
--dv-flex-wrapnowrapflex-wrap value

Indicator

TokenDefaultControls
--dv-ind-colorvar(--dv-color-primary-filled)Badge dot color
--dv-ind-size10pxBadge dot diameter
--dv-ind-offset0pxInset distance from the container edge

Input (shared)

TokenDefaultControls
--dv-input-fzvar(--dv-input-fz-md) = var(--dv-font-size-sm)Input font size
--dv-input-sizevar(--dv-input-size-md) = 2.625remInput height
--dv-input-radiusvar(--dv-radius-sm)Input corner radius

Kbd

TokenDefaultControls
--dv-kbd-fzvar(--dv-font-size-xs)Keyboard key font size
--dv-kbd-padding2px 6pxKeyboard key padding

List

TokenDefaultControls
--dv-list-fzvar(--dv-font-size-md)List item font size
--dv-list-spacing0Gap between list items
--dv-list-style-typediscCSS list-style-type (ul) or decimal (ol)

Loader

TokenDefaultControls
--dv-loader-sizevar(--dv-loader-size-md) = 36pxSpinner diameter

Mark

TokenDefaultControls
--dv-mark-bgvar(--dv-color-yellow-light)Highlight background color

NavLink

TokenDefaultControls
--dv-nl-bgtransparentResting background
--dv-nl-hovervar(--dv-color-surface)Hover background
--dv-nl-colorvar(--dv-color-text)Text color (active: primary-light-color)

NativeSelect

TokenDefaultControls
--dv-native-select-colorvar(--dv-color-primary-filled)Arrow / accent color

Overlay

TokenDefaultControls
--dv-overlay-color#000Background fill color
--dv-overlay-opacity0.5Fill opacity (0–1)
--dv-overlay-blur4px (when blur is enabled)Backdrop blur amount
--dv-overlay-zvar(--dv-z-overlay)z-index override

Pagination

TokenDefaultControls
--dv-pagination-fzvar(--dv-font-size-sm)Page control font size
--dv-pagination-radius0.25remControl corner radius
--dv-pagination-colorvar(--dv-color-primary-filled)Active page accent color

Pill

TokenDefaultControls
--dv-pill-heightvar(--dv-pill-height-sm) = 1.25remPill height
--dv-pill-fzvar(--dv-pill-fz-sm) = 0.625remPill font size
--dv-pill-radius10000pxPill corner radius

Progress

TokenDefaultControls
--dv-progress-sizevar(--dv-progress-size-md) = 12pxBar height
--dv-progress-radiusvar(--dv-radius-xl)Bar corner radius

Radio

TokenDefaultControls
--dv-radio-sizevar(--dv-radio-size-md) = 1.25remRadio button size
--dv-radio-colorvar(--dv-color-primary-filled)Checked fill color
--dv-radio-icon-color#fffInner dot color

Rating

TokenDefaultControls
--dv-rating-colorvar(--dv-color-yellow-filled)Star fill color
--dv-rating-size1.5remStar size

RingProgress

TokenDefaultControls
--dv-rp-size120pxRing diameter

ScrollArea

TokenDefaultControls
--dv-scroll-size6pxScrollbar track thickness

SegmentedControl

TokenDefaultControls
--dv-segmented-fzvar(--dv-segmented-fz-md) = font-size-smSegment font size
--dv-segmented-radiusvar(--dv-radius-sm)Corner radius
--dv-segmented-trackvar(--dv-color-gray-2)Track (inactive) background
--dv-segmented-colorvar(--dv-color-default)Active segment background
--dv-segmented-active-textvar(--dv-color-default-color)Active segment text color

SimpleGrid

TokenDefaultControls
--dv-sg-cols1Number of columns
--dv-sg-spacingvar(--dv-spacing-md)Gap between cells
--dv-sg-v-spacingvar(--dv-sg-spacing)Row gap (defaults to spacing)

Skeleton

TokenDefaultControls
--dv-skeleton-height1remSkeleton block height
--dv-skeleton-width100%Skeleton block width
--dv-skeleton-radiusvar(--dv-radius-sm)Corner radius

Slider

TokenDefaultControls
--dv-slider-colorvar(--dv-color-primary-filled)Filled track and thumb color
--dv-slider-size0.5remTrack height
--dv-slider-radius999pxTrack corner radius

Stepper

TokenDefaultControls
--dv-stepper-fzvar(--dv-font-size-sm)Step label font size
--dv-stepper-step-radius50%Step indicator corner radius

Switch

TokenDefaultControls
--dv-switch-sizevar(--dv-switch-size-md) = 1.25remTrack height
--dv-switch-radius9999pxTrack corner radius
--dv-switch-colorvar(--dv-color-primary-filled)Checked fill color

Table

TokenDefaultControls
--dv-table-hz-spacingvar(--dv-spacing-xs)Horizontal cell padding
--dv-table-v-spacingvar(--dv-spacing-xs)Vertical cell padding
--dv-table-border-colorvar(--dv-color-border)Cell border color
--dv-table-caption-sidebottomCSS caption-side value

ThemeIcon

TokenDefaultControls
--dv-ti-sizevar(--dv-ti-size-md) = 2remIcon container size
--dv-ti-radiusvar(--dv-radius-default)Corner radius

Timeline

TokenDefaultControls
--dv-timeline-bullet-size1.25remBullet circle diameter
--dv-timeline-line-width2pxConnecting line width
--dv-timeline-bullet-radius50%Bullet corner radius
--dv-timeline-item-colorvar(--dv-color-primary-filled)Active item accent color

Tooltip

TokenDefaultControls
--dv-tooltip-bgvar(--dv-color-gray-9)Tooltip background
--dv-tooltip-color#fffTooltip text color

Transition

TokenDefaultControls
--dv-transition-durationvar(--dv-motion-duration-normal)Enter/exit transition duration
--dv-transition-easingvar(--dv-motion-ease-enter)Enter/exit easing curve