Dropdown
Toggleable contextual overlays for displaying lists of links, actions, or custom content. Dropdowns support directional placement, glass styling, split buttons, and dark mode out of the box.
Basic Dropdown
Split Button & Glass
Placement Variants
Engine wiring
API Reference
Modifier classes
| Class | Description |
|---|---|
.vd-dropdown | Root container. Holds toggle + menu. |
.vd-dropdown-toggle | Clickable trigger (button or anchor). `data-vd-dropdown-toggle` is also accepted. |
.vd-dropdown-menu | The menu element. Visibility toggled via `.is-open`. |
.vd-dropdown-item | A menu item. Disabled variants: `.is-disabled` / `.disabled`. |
.vd-dropdown-divider | Horizontal rule between item groups. |
.vd-dropdown-item-danger | Item styled as destructive action. |
.vd-dropdown-split | Container modifier: split-button variant (action + caret toggle). |
.vd-dropdown-glass | Container modifier: glass-styled menu (uses `--vd-glass-*` tokens). |
.vd-dropdown-dropup | Container modifier: opens upward instead of downward. |
.vd-dropdown-dropright / .vd-dropdown-dropleft | Container modifier: horizontal placement. |
.vd-dropdown-menu-end / .vd-dropdown-menu-start / .vd-dropdown-menu-top | Auto-applied to position the menu; can also be set statically. |
Base classes
| Class | Description |
|---|---|
.vd-dropdown | Container with `position: relative`. Click capture boundary. |
.vd-dropdown-toggle | Button with caret; receives `aria-haspopup="true"` and `aria-expanded` toggling. |
.vd-dropdown-menu | Absolute-positioned menu, hidden by default, fade-in on `.is-open`. |
.vd-dropdown-item | Block-level link/button. Focusable. Hover/focus highlight via `--vd-color-primary-rgb`. |
.vd-dropdown-divider | 1px line via `--vd-border-color`; vertical margin uses Fibonacci scale. |
.vd-dropdown-item-danger | Foreground `--vd-color-red-6` / `--vd-color-red-5`; signals destructive action. |
CSS Variables
| Variable | Default | Description |
|---|---|---|
--vd-dropdown-bg | var(--vd-color-gray-0) | Menu background |
--vd-dropdown-text | var(--vd-color-gray-9) | Menu foreground |
--vd-dropdown-border-color | var(--vd-border-color) | Menu border |
--vd-dropdown-radius | var(--vd-border-radius) | Menu corner radius |
--vd-dropdown-shadow | var(--vd-shadow-md) | Menu elevation shadow |
--vd-dropdown-min-width | 12rem | Menu minimum width |
--vd-dropdown-padding | 0.5rem | Item vertical/horizontal padding |
--vd-dropdown-z-index | 1050 | Stacking above page content |
Accessibility
- Trigger carries
aria-haspopup="true"and togglesaria-expanded. - Menu carries
role="menu"andaria-hiddenmirroring its open state. - Arrow keys cycle items, Home/End jump, Escape closes, typeahead jumps to the first matching label.
- Focus is restored to the trigger when the menu closes.