Context menu: File list
Give every row its own menu. The open row keeps a highlight, and a destructive item hands off to an alert dialog for confirmation.
Quarterly report.pdf
Brand assets
Roadmap 2027.md
This adds the example as components/examples/context-menu/file-list.tsx, together with the Context menu component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/context-menu-file-list.jsonTo add only the component, follow the Context menu installation.
Props in this example
The Context menu props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "destructive" | "default" |
onClickRuns on click, Enter or Space. The menu closes after a short blink. | (event) => void | – |
| Prop | Type | Default |
|---|---|---|
checked | boolean | – |
onCheckedChange | (checked: boolean, details) => void | – |
Every prop is in the Context menu API reference.
- Controlled
- Disabled
- Hold feedback
- Long content
- Nested submenus
- Inside a sheet
- Render as another element
- Right to left
See them all, with keyboard support and accessibility notes, on the Context menu page.
- Alert dialogA confirmation dialog for destructive or important actions that waits for async work, and becomes a bottom sheet on phones.
- CommandA searchable list of actions, inline or as a ⌘K palette, with pages, shortcuts and highlighted matches.
- DialogA window over the page for forms and focused tasks, with a pinned header and footer, nesting, and a swipeable bottom sheet on phones.
- DrawerA panel that slides in from any edge and follows your finger, with snap points, a working handle and nested drawers that stack.
- Dropdown menuA menu of actions and options behind a button, with groups, submenus, checkbox and radio items, and shortcuts.
- Hover cardA preview card that opens when a link is hovered or focused, for content sighted users can glance at.