- Accordion
- Alert Dialog
- Alert
- Autocomplete
- Avatar
- Badge
- Button Group
- Button
- Card
- Carousel
- Chart
- Checkbox
- Clipboard
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Editable
- Field
- File Upload
- Floating Panel
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- QR Code
- Radio Group
- Rating Group
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Splitter
- Steps
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle Group
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add @shark-ui/menu
Usage
import { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, } from "@/components/ui/menu";
<Menu> <MenuTrigger /> <MenuContent> <MenuItemGroup> <MenuItemGroupLabel /> <MenuItem value="item-1" /> <MenuSub> <MenuSubTrigger /> <MenuSubContent> <MenuItem /> </MenuSubContent> </MenuSub> <MenuSeparator /> <MenuItemGroup> <MenuRadioItem /> </MenuItemGroup> <MenuSeparator /> <MenuCheckboxItem /> </MenuItemGroup> </MenuContent> </Menu>
Positioning
Control the position of the menu relative to the trigger using the positioning prop.
Examples
Nested Menu
Use <MenuSub />, <MenuSubTrigger />, and <MenuSubContent /> for nested submenus.
Icons
Combine icons with labels for quick scanning.
Shortcuts
Use <MenuShortcut /> to show keyboard hints next to menu items.
Checkboxes
Use <MenuCheckboxItem /> for toggles.
Radio Group
Use <MenuRadioGroup /> and <MenuRadioItem /> for a single selection from a set of options.
With Link
Use the asChild prop on <MenuItem /> with a anchor element to render a link.
With Group Label
Use <MenuGroup /> with <MenuGroupLabel /> or the heading prop to group related items under a label.
Open a Dialog
Open a dialog from a <MenuItem /> with the onClick prop and controlled state.
Destructive
Use variant="destructive" on <MenuItem /> for irreversible actions like delete.
API Reference
Menu
Root element of the menu component.
| Prop | Type | Default |
|---|---|---|
positioning | PositioningOptions | — |
open | boolean | — |
defaultOpen | boolean | — |
onOpenChange | (details: OpenChangeDetails) => void | — |
onSelect | (details: SelectionDetails) => void | — |
closeOnSelect | boolean | true |
lazyMount | boolean | true |
unmountOnExit | boolean | true |
MenuTrigger
Button that opens the menu. Renders a button. Use asChild to delegate to a child element.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
MenuContent
Content container for menu items. Renders a div inside a portal.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
className | string | — |
MenuItem
A single menu option. Renders a div (or child when asChild).
| Prop | Type | Default |
|---|---|---|
value | string | required |
variant | "default" | "destructive" | "default" |
asChild | boolean | — |
disabled | boolean | — |
closeOnSelect | boolean | — |
onSelect | VoidFunction | — |
MenuCheckboxItem
A menu option with a checkbox. Use checked and onCheckedChange for controlled state.
| Prop | Type | Default |
|---|---|---|
value | string | required |
checked | boolean | — |
onCheckedChange | (checked: boolean) => void | — |
disabled | boolean | — |
MenuRadioGroup
Group of mutually exclusive options. Use value and onValueChange for controlled state.
| Prop | Type | Default |
|---|---|---|
value | string | — |
onValueChange | (details: ValueChangeDetails) => void | — |
heading | string | — |
MenuRadioItem
A single option in a radio group.
| Prop | Type | Default |
|---|---|---|
value | string | required |
disabled | boolean | — |
MenuGroup
Groups related items. Use heading or <MenuGroupLabel /> for a label.
| Prop | Type | Default |
|---|---|---|
heading | string | — |
MenuGroupLabel
Label for a group. Renders inside <MenuGroup />.
MenuSeparator
Visual divider between items. Renders an hr.
MenuSub / MenuSubTrigger / MenuSubContent
Submenu: wrap a nested <Menu />-like structure. <MenuSubTrigger /> opens the submenu; <MenuSubContent /> holds the nested items.
MenuShortcut
Optional keyboard hint shown next to an item (e.g. ⌘S). Renders a span.
For a complete list of props, see the Ark UI documentation.
On This Page