Component libraryDropdown menu
Dropdown menu
FreeGrouped actions, selections and nested menus.
npx shadcn@latest add https://tidalui.com/r/dropdown-menu.jsonInstallation
Terminal
Import components/ui/tidal.css, components/ui/dropdown-menu.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.
Usage
Complete example source · Dependency and asset manifest
Loading the complete example…
API & behavior
Compound Radix Dropdown Menu2.2.1 family. TidalDropdownMenu forwards Root open/defaultOpen/onOpenChange/modal with theme(light default)/dir(ltr default); pass matching theme and direction explicitly for Portal surfaces. Trigger forwards native button props/ref, including disabled/asChild. Content/SubContent forward Radix positioning, collision, event, focus and ref props; default sideOffset8/6, collisionPadding12 and looptrue. Content/SubContent own their Portal and styled DOM surface; asChild/forceMount are not exposed and no additional Portal wrapper is needed. Item forwards native Radix Item props/ref/asChild and optional destructive styling, but never assumes an action or confirmation. Provide clear action text; icons should be aria-hidden. Label/Separator/Group and Sub/SubTrigger compose grouped/nested menus; RadioGroup/RadioItem use controlled value/onValueChange; CheckboxItem uses controlled boolean/indeterminate checked/onCheckedChange. Only Root provides defaultOpen. Menu choices are not native form fields and do not implement defaultValue/defaultChecked. Checkbox/Radio/SubTrigger supply their internal indicator/chevron and do not support asChild; Item and Trigger support asChild for a single native element. Item children remain yours, including icons, descriptions and native links. Use onSelect(event) and event.preventDefault() to keep a choice menu open; onCheckedChange/onValueChange remain consumer-owned. Keyboard Enter/Space/Down opens, arrows/Home/End/typeahead navigate and skip disabled items, Right/Left enter/leave submenus according to dir, Escape closes and returns focus. Shortcut labels are decorative unless consumers implement handlers. Persistent measured highlight preserves contrast, adapts to surface resize/scroll and excludes disabled items. Portal popups fit the viewport and scroll internally, with44px rows and visible keyboard outlines. Scoped tidal.css/dropdown-menu.css and finite reduced-motion-safe surface/highlight/control animation. No form field, navigation, network, storage or destructive action is introduced by the component.
Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.