Skip to content
loseta

Components / Overlays

Dropdown Menu

Displays a menu to the user, triggered by a button.

Status stableInstalls popover-primitive, menuWorks with avatar, button

Installation

pnpm dlx loseta add dropdown-menu
npx loseta add dropdown-menu

Examples

Shortcuts

Icons

Checkboxes

Checkboxes icons

Radio group

Radio icons

Destructive

Avatar

Right-to-left

Accessibility and behavior

  • Requires JavaScript for open/close and keyboard navigation. Toggle aria-hidden on [data-popover] and aria-expanded on the trigger. Group labels use role="heading" with aria-level; checkable items use role="menuitemcheckbox" or role="menuitemradio" with aria-checked. A submenu wraps its trigger and nested [data-popover] in a role="none" element; the trigger carries aria-haspopup="menu" and aria-expanded and the panel opens with data-side="inline-end". Shortcuts use [data-slot="shortcut"], indicators [data-slot="indicator"].

Files

components/dropdown-menu.cssbase
styles/nova/dropdown-menu.cssstyle

Install contract

The CLI writes the base file under components/, the visual file for the selected style under styles/<name>/, and any primitive dependency underprimitives/. The generated index.css imports them in the right layer order.

← Back to components

loseta is MIT licensed. Built with native CSS, no runtime. Inspired byshadcn/ui.