Context Menu
A component that displays a menu at the pointer's location, triggered by a right-click or long press. Implements the ARIA menu pattern for proper accessibility support.
Supports submenus
Supports checkable items (single or multiple) with optional indeterminate state
Focus is fully managed
Full keyboard navigation
Typeahead support
Triggers with a long press on touch devices
Architecture
Reference
-
Context Menu
The root container that manages the state and behavior of the context menu system. Coordinates the interaction between triggers and contents. Handles right-click and long press events to display the menu at the appropriate position.
-
Content
The container that holds the context menu items. Manages keyboard interactions, focus behavior and positioning relative to the trigger point. Implements proper ARIA attributes for accessibility and handles collision detection with viewport boundaries.
-
Attributes
- aria-labelstring/default: -
Accessible label for the context menu content when a visible label is not present.
-
-
-
Item
An interactive menu item that can trigger an action when selected. Supports disabled states and keyboard navigation with proper ARIA attributes for accessibility.
-
Attributes
- disabledboolean/default: false
When
true
, prevents the user from selecting this item. - shortcutstring/default: -
Displays a keyboard shortcut hint for the menu item. This is purely informational and does not trigger the shortcut functionality.
-
-
Events
- onSelect
Event handler called when the item is clicked or has a keydown event (Space or Enter).
-
-
-
Checkbox
A menu item that can be checked, unchecked or set to an indeterminate state. Implements proper ARIA attributes for accessibility.
-
Attributes
- checkedboolean/default: -
The controlled checked state of the item. Must be used in conjunction with
onCheckedChange
. - disabledboolean/default: false
When
true
, prevents the user from interacting with this item.
-
-
Events
- onCheckedChange
Event handler called when the checked state of the item changes.
-
-
-
Radio Group
A container for grouping multiple radio items. Ensures that only one item in the group can be selected at a time.
-
Attributes
- valuestring/default: -
The value of the currently selected radio item in the group. Must be used in conjunction with
onValueChange
.
-
-
Events
- onValueChange
Event handler called when the selected value in the radio group changes.
-
-
-
Radio Group Item
A selectable item within a radio group that can only be selected exclusively within its group. Implements proper ARIA attributes for accessibility.
-
Attributes
- disabledboolean/default: false
When
true
, prevents the user from selecting this item. - valuestring/default: -
The unique value of the item. Used to identify the selected item within the radio group.
-
-
Events
- onSelect
Event handler called when the user selects the item.
-
-
-
Sub
Container component that manages the state and behavior of a submenu. Coordinates the interaction between trigger and content components.
-
Sub Content
The container that holds the submenu content. Manages keyboard interactions, positioning behavior and implements proper ARIA attributes for accessibility.
-
Attributes
- aria-labelstring/default: -
Accessible label for the submenu content when a visible label is not present.
- aria-labelled-bystring/default: -
References the ID of the element that labels the submenu content.
-
-
Keyboard
- Space
When focus is on a menu item, activates the item or toggles its checked state.
- Enter
When focus is on a menu item, activates the item or toggles its checked state.
-
Moves focus to the next menu item.
-
Moves focus to the previous menu item.
-
When focus is on a context menu sub-trigger, opens its submenu.
-
When focus is on a context menu sub-trigger, closes its submenu.