Context menuNew
Actions where you right-click: the menu grows from the exact point, a long press opens it on touch, and Shift+F10 from the keyboard.
Used forFile and asset gridsCanvas and boardsTablesText editors
Install with the shadcn CLI
Older shadcn CLI, or a network that blocks ui.shadcn.com? Install by URL: shadcn add https://hairlineui.com/r/context-menu.json. More
Templates
Need the whole page?
65 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.
Where it’s used
File and asset grids
Rename, move, delete on a right-click.
Canvas and boards
Actions for the item under the pointer.
Tables
Row actions without a "…" column.
Text editors
Custom actions on a selection.
What it handles for you
A right-click menu that only works with a mouse leaves phones and keyboards out; this one has a way in for each.
Three ways in
Right-click, long press (500ms, cancelled by movement) and Shift+F10.
From the point
Grows from where you clicked; flips and shifts to fit.
Same rows as the dropdown
Gliding highlight, typeahead and checkable rows.
Callout suppressed
iOS doesn't show its own menu on the long press.
Overview
Custom right-click menus often forget touch and the keyboard. This one opens at the pointer on right-click, after a 500ms long press on touch (the area dims slightly while it waits), and on Shift+F10 or the menu key. It grows from the exact point, stays inside the window, and right-clicking elsewhere moves it there.
States
- waiting
- On touch, the area eases to 0.985 and 80% while the long press counts down.
- open
- The menu rises from the point (320ms).
- pick
- It closes and focus returns to the area.
Usage
Depends on lucide-react, installed for you by the CLI along with the keyframes it needs.
Works with
Props
- children
- ReactNode
- The area with the menu.
- items
- MenuEntry[]
- Same rows as the dropdown menu.
- label= "Actions"
- string
- Accessible name of the menu.
- onOpenChange
- (open) => void
- Opened or closed.
Accessibility and motion
- Placement, presence and dismissal live in floating.ts, shared by tooltip, popover, dropdown and context menus: they all flip, shift, enter and leave the same way.
- The area takes focus (tabIndex 0) so Shift+F10 can reach it.
- Reduced motion: it fades; the area doesn't dim.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
Source
Registry item: /r/context-menu.json


