Dropdown menu
A menu that grows out from under its button, or from the pointer on a right click, with one highlight that glides from item to item.
Examples
Default
It grows out from under its button, and one highlight glides from item to item.
Checkboxes and radios
They keep the menu open, and the other items line up with their text.
Submenus
A submenu grows out of its item, and the highlight glides into it.
Context menu
It grows out from the pointer on a right click, a long press or Shift F10.
Installation
npx shadcn@latest add https://kinoui.com/r/menu.json- Files
lib/keys.tsxlib/reduce-motion.tscomponents/kino/kbd.tsxcomponents/kino/separator.tsxlib/refs.tslib/resize.tslib/run-progress.tslib/highlight.tslib/list-rows.tsxlib/grip.tslib/scroll.tslib/panel.tsxlib/popup.tscomponents/kino/menu.tsx- Packages
@ui-sdk/core@ui-sdk/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Menu
Groups the parts and holds whether it is open. Other props go to ui-sdk's Menu (opens in a new tab).
MenuTrigger
The button that opens it. Pass yours with render. Other props go to ui-sdk's MenuTrigger (opens in a new tab).
MenuContextTrigger
The area that opens it on a right click, a long press on a touch screen, or Shift F10. Give it tabIndex={0}, or put it on something focusable, so the keyboard can open the menu too. A <div>; other props go to ui-sdk's MenuContextTrigger (opens in a new tab).
MenuContent
The menu. It grows out from under its trigger, or from the pointer, and folds back into it, and scrolls past 24rem. Other props go to ui-sdk's MenuContent (opens in a new tab).
MenuGroup
Groups items under a MenuGroupLabel. Other props go to ui-sdk's MenuGroup (opens in a new tab).
MenuGroupLabel
Names a group. In a menu with checkbox items, it lines up with the items' text. Other props go to ui-sdk's MenuGroupLabel (opens in a new tab).
MenuItem
An action, with an icon before its text. Picking it closes the menu. A link is render={<a href='…' />}. Other props go to ui-sdk's MenuItem (opens in a new tab).
MenuCheckboxItem
An item that turns something on or off, with a tick that scales in, at the row's end when an icon comes before its text. It keeps the menu open. Other props go to ui-sdk's MenuCheckboxItem (opens in a new tab).
MenuRadioGroup
Holds the radio items of which one is picked. Takes value, defaultValue and onValueChange. Other props go to ui-sdk's MenuRadioGroup (opens in a new tab).
MenuRadioItem
One choice of a radio group: the picked row is tinted, with a medium label. It takes a value and keeps the menu open. Other props go to ui-sdk's MenuRadioItem (opens in a new tab).
MenuSeparator
A line between groups. Other props go to ui-sdk's MenuSeparator (opens in a new tab).
MenuItemIcon
Holds an icon at a row's start, sized and tinted with its label. Pass mirror for one that points along the line, which flips right to left. Other props go to ui-sdk's MenuItemIcon (opens in a new tab).
MenuShortcut
The keys at a row's end, hidden from screen readers. A row's shortcut draws it for you: use it for a hint of your own, from its shortcut or its children. Other props go to ui-sdk's MenuShortcut (opens in a new tab).
MenuSub
Groups a submenu's trigger and content. Other props go to ui-sdk's MenuSub (opens in a new tab).
MenuSubTrigger
The item that opens a submenu, on hover, a press, or the arrow key that points into it. Other props go to ui-sdk's MenuSubTrigger (opens in a new tab).
MenuSubContent
The submenu. It grows out of its item, with its first row level with it. In a sheet it opens as a sheet over the menu's. Takes sideOffset; other props go to ui-sdk's MenuSubContent (opens in a new tab).
Data attributes
Accessibility
- Enter, Space or the down arrow on the trigger opens the menu on its first item; the up arrow opens it on its last.
- A context menu opens with the context menu key or Shift F10 on its focused area, as well as with the pointer.
- Arrow keys move between items, Home and End go to the first and the last, and typing a letter goes to the next item that starts with it.
- Enter or Space picks an item. The arrow that points into a submenu opens it, and the other arrow or Escape closes it.
- Focus goes back to the trigger when the menu closes.
- A disabled item stays focusable, so it can be found, but can’t be picked.
- A checkbox item is announced as checked or not, and a radio item as picked or not. On screen a checked item shows its tick, and a picked radio item its tint and medium label, so neither relies on colour alone.
- An agent finds the menu and its items in
snapshot()by their names, and opens it and picks an item withact(). - When the system asks for less motion, menus only fade and the highlight moves at once.
For agents
What an agent reads on this example with snapshot(), and the actions it can call with act().
Once open
The Agent bridge page sets up snapshot() and act() in your app.