Sourceful Energy

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

PropTypeDefaultDescription
openboolean-The controlled open state of the dropdown menu.
defaultOpenbooleanfalseThe default open state when uncontrolled.
onOpenChange(open: boolean) => void-Callback when the open state changes.
modalbooleantrueWhether 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