Skip to content
Playground

Dropdown Menu

Contextual commands and selection controls in an anchored menu.

Contextual commands and selection controls in an anchored menu.

Backed by Base UI Menu for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.

TSX
import { Button, DropdownMenu } from "@zentara-co/zenos-ui";

Use checkbox items for independent view options and a radio group when exactly one option should be active.

Use Item for commands and LinkItem for navigation. Shortcut is presentation for a command the application already implements.

Content hides portal and positioning internals. Arrow keys navigate, Home/End jump through items, Escape closes the menu, and focus returns to the trigger. Use ContextMenu when invocation belongs to a context-menu gesture rather than a visible trigger.

Dropdown menus and submenus fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically.

Open each menu. The first animates in and out. disableMotion makes the second appear and disappear immediately.

Style the visible trigger through its rendered button, then style DropdownMenu.Content separately because the popup is rendered in a portal. Stable data-slot attributes and Base UI’s data-highlighted state can target items, labels, separators, and shortcuts without changing menu behavior.

DropdownMenu.Root
DropdownMenu.Trigger
DropdownMenu.Content
DropdownMenu.Item
DropdownMenu.CheckboxItem
DropdownMenu.RadioGroup
DropdownMenu.RadioItem
DropdownMenu.Sub
DropdownMenu.Separator
DropdownMenu.Shortcut
PropTypeDefaultDescription
open boolean — Controlled open state.
defaultOpen boolean false Initial uncontrolled state.
onOpenChange (open: boolean, eventDetails) => void — Runs when visibility changes.
render ReactElement | function — Composes the trigger with another element.
side / align Base UI position values — Popup placement supplied on Content.
Content.disableMotion boolean false Disables enter and exit motion on Content or SubContent.
checked / onCheckedChange boolean / (checked: boolean, eventDetails) => void — Controls a CheckboxItem selection.
value / onValueChange string / (value: string, eventDetails) => void — Controls the selected RadioGroup item.
disabled boolean false Prevents an item from receiving selection.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

Base UI provides menu roles, focus movement, typeahead, selection semantics, Escape dismissal, and focus return. Give icon-only triggers an accessible name. Use menu items for short actions and choices; use ordinary page content when users need to read or interact with a complex form.