- Home
- Primitives
- Context Menu
Context Menu
Right-click triggered menu.
Preview
This preview uses documentation-only styling. Ship with one of the included recipe outputs (CSS, Tailwind, or UnoCSS) for production styles.
Right-click triggered menu.
Usage
Compose Root, Trigger, Content, Item, CheckboxItem, RadioGroup, RadioItem, Separator, Label.
import * as ContextMenu from "@solidiom/context-menu"
;<ContextMenu.Root>Context Menu content</ContextMenu.Root>Installation
Install the package with pnpm add @solidiom/context-menu. The package requires compatible solid-js and @solidjs/web peer dependencies.
Parts
Context Menu exposes 9 parts:
- Root —
data-part="root". - Trigger —
data-part="trigger". - Content —
data-part="content". - Item —
data-part="item". - CheckboxItem —
data-part="checkboxitem". - RadioGroup —
data-part="radiogroup". - RadioItem —
data-part="radioitem". - Separator —
data-part="separator". - Label —
data-part="label".
Styling
Context Menu carries data-scope="context-menu" and data-part attributes on each part for CSS/recipe targeting. State attributes like data-state, data-disabled, and data-highlighted are exposed where applicable.
Keyboard & behavior
This primitive has no keyboard interaction. It renders content that does not independently receive focus or respond to key events.
Composition
Context Menu is designed to compose with other primitives. Its parts can be combined with Field, Button, or other primitives as needed.
SSR and hydration
Context Menu renders as semantic HTML during server rendering. Interactive behavior (keyboard handlers, state management) activates on hydration without layout shift.