Context Menu
Displays a menu of actions triggered by a right click.
Installation
Usage
<ContextMenu>
<ContextMenuTrigger>Right click here</ContextMenuTrigger>
<ContextMenuContent>
<ContextMenuItem>Profile</ContextMenuItem>
<ContextMenuItem>Billing</ContextMenuItem>
<ContextMenuItem>Team</ContextMenuItem>
<ContextMenuItem>Subscription</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>Composition
Use the following composition to build a ContextMenu:
ContextMenu
├── ContextMenuTrigger
└── ContextMenuContent
├── ContextMenuGroup
│ ├── ContextMenuLabel
│ ├── ContextMenuItem
│ └── ContextMenuItem
├── ContextMenuSeparator
├── ContextMenuGroup
│ ├── ContextMenuLabel
│ ├── ContextMenuCheckboxItem
│ └── ContextMenuCheckboxItem
├── ContextMenuSeparator
├── ContextMenuGroup
│ ├── ContextMenuLabel
│ └── ContextMenuRadioGroup
│ ├── ContextMenuRadioItem
│ └── ContextMenuRadioItem
└── ContextMenuSub
├── ContextMenuSubTrigger
└── ContextMenuSubContent
└── ContextMenuGroup
├── ContextMenuItem
└── ContextMenuItemBasic
A simple context menu with a few actions.
Submenu
Use ContextMenuSub to nest secondary actions.
Shortcuts
Add ContextMenuShortcut to show keyboard hints.
Groups
Group related actions and separate them with dividers.
Icons
Combine icons with labels for quick scanning.
Checkboxes
Use ContextMenuCheckboxItem for toggles.
Radio
Use ContextMenuRadioItem for exclusive choices.
Destructive
Use variant="destructive" to style the menu item as destructive.
Sides
Control submenu placement with side and align parameters.
RTL
To enable RTL support in Blazix, see the RTL configuration guide.
Translated with AI for the demo, so it may have mistakes.
API Reference
ContextMenu
ContextMenuCheckboxItem
Other attributes are passed to the element it renders.
ContextMenuContent
Other attributes are passed to the element it renders.
ContextMenuGroup
Other attributes are passed to the element it renders.
ContextMenuItem
Other attributes are passed to the element it renders.
ContextMenuLabel
Other attributes are passed to the element it renders.
ContextMenuPortal
ContextMenuRadioGroup
Other attributes are passed to the element it renders.
ContextMenuRadioItem
Other attributes are passed to the element it renders.
ContextMenuSeparator
Other attributes are passed to the element it renders.
ContextMenuShortcut
Other attributes are passed to the element it renders.
ContextMenuSub
ContextMenuSubContent
Other attributes are passed to the element it renders.
ContextMenuSubTrigger
Other attributes are passed to the element it renders.
ContextMenuTrigger
Other attributes are passed to the element it renders.