An accessible context menu component built on Base UI with smooth Motion spring scale and submenu slide animations.
Made by AxylAn animated context menu with spring entrance transitions, nested submenus, checkable items, radio items, shortcuts, and destructive styling.
Installation
File Structure
Usage
RTL
The same context menu pattern rendered right-to-left with Base UI DirectionProvider.
Use Base UI's DirectionProvider together with dir="rtl" on the demo
container to render the menu from right to left. The provider keeps popup
positioning and keyboard navigation aware of the text direction.
Nested submenus open toward the logical inline end, check and radio indicators move to the correct side, and submenu animations follow the active direction.
Examples
File Actions
Context menu tailored for file systems with action icons, quick shortcuts, nested sharing options, and danger actions.
Props
ContextMenu
| Prop | Type | Default |
|---|---|---|
open? | boolean | - |
defaultOpen? | boolean | false |
onOpenChange? | (open: boolean) => void | - |
ContextMenuContent
| Prop | Type | Default |
|---|---|---|
align? | "start" | "center" | "end" | "start" |
alignOffset? | number | 4 |
side? | "top" | "right" | "bottom" | "left" | "inline-start" | "inline-end" | "right" |
sideOffset? | number | 0 |
disableAnimation? | boolean | false |
positionerClassName? | string | - |
ContextMenuItem
| Prop | Type | Default |
|---|---|---|
disabled? | boolean | false |
inset? | boolean | false |
variant? | "default" | "destructive" | "default" |
ContextMenuCheckboxItem
| Prop | Type | Default |
|---|---|---|
checked? | boolean | - |
onCheckedChange? | (checked: boolean) => void | - |
disabled? | boolean | false |
inset? | boolean | false |
ContextMenuRadioItem
| Prop | Type | Default |
|---|---|---|
value? | string | - |
disabled? | boolean | false |
inset? | boolean | false |
ContextMenuSubTrigger
| Prop | Type | Default |
|---|---|---|
disabled? | boolean | false |
inset? | boolean | false |
ContextMenuSubContent
| Prop | Type | Default |
|---|---|---|
align? | "start" | "center" | "end" | "start" |
alignOffset? | number | -4 |
side? | "top" | "right" | "bottom" | "left" | "inline-start" | "inline-end" | "inline-end" |
sideOffset? | number | 0 |
disableAnimation? | boolean | false |
Built by Axyl. A motion-first component registry for React.
Last updated: 9/11/2026