Overlays
v1.0.0Added in 1.0.0
The action menu: icons, descriptions, shortcuts, badges, checkbox and radio items, submenus, and an iOS action sheet on phones.
Click the trigger and the menu grows out of it on a quick spring. Hover or use the arrow keys to move the highlight (it wraps around), type a letter to jump to an item, Right opens a submenu and Left closes it, Enter or Space picks, Escape closes and focus returns to the trigger. The shortcuts written next to items run them while the menu is open, and an optional shortcut opens the menu from anywhere. Checkbox and radio items tick in place (the check draws itself) and keep the menu open; danger items turn red. On a phone the same menu slides up as an action sheet: 48px rows, the title centered on top, a Cancel button where the thumb is, and drag down to dismiss. A submenu row slides a new page in from the right with a Back row while the sheet resizes to fit. Opened from the keyboard, the sheet focuses its first row; the arrow keys move between rows, Right opens a submenu page and Left goes back. With reduced motion the menu and the pages fade instead of moving.
npx wingo-ui@latest add dropdown-menu
Pegas city bike
$420
Brooklyn · 2 days ago
Click ⋯ or focus it and press Enter. It opens on the bottom side (flipping when there is no room), aligned to the start, at least 192px wide. Arrow keys wrap around; Ctrl+E, Ctrl+D and Ctrl+Backspace run their item while it is open.
Below 768px it is an action sheet titled “Pegas city bike” ($420 · Brooklyn) with “Cancel” at the bottom; Share opens a page with “‹ Back”. Untitled sheets are read as “Actions”.