Dropdown Menu
Displays a menu to the user, typically triggered by a button.
Installation
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@sourceful-energy/ui"Usage
Examples
Device Actions
With Checkboxes
With Radio Items
With Submenus
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | - | The controlled open state of the dropdown menu. |
| defaultOpen | boolean | false | The default open state when uncontrolled. |
| onOpenChange | (open: boolean) => void | - | Callback when the open state changes. |
| modal | boolean | true | Whether the dropdown menu should be modal. |
Accessibility
- Built on Radix UI DropdownMenu for full accessibility
- Keyboard navigation (Arrow keys, Enter, Escape)
- WAI-ARIA menu pattern
- Focus management and trapping
- Typeahead support for quick navigation