ui

Context Menu

Displays a menu to the user — such as a set of actions or functions — triggered by a button. Built with Base UI and Tailwind CSS. Copy-paste ready.

Installation

Examples

Demonstrates a nested submenu that opens from a parent item, revealing a secondary list of options without closing the parent.

Shortcuts

Each menu item shows a keyboard shortcut hint aligned to the right of its label using CommandShortcut.

Group

Items are organized into named groups with visual separators using MenuGroup and MenuGroupLabel.

Icons

Each menu item includes a leading icon to aid quick visual scanning of the available actions.

Checkboxes

Menu items can be toggled on or off using MenuCheckboxItem, persisting their checked state across menu opens.

Radio

A MenuRadioGroup inside the menu enforces single selection among a set of mutually exclusive options.

Destructive

Shows a destructive variant item styled in red for irreversible actions such as delete or remove.

Sides

Demonstrates the available alignment positions and side placements for the context menu popup relative to its trigger.

Inside Dialog

Opens the context menu within a dialog to demonstrate correct overlay stacking and focus management.

Bookmark List

A list of bookmark rows where right-clicking reveals open, copy link, star/unstar, share, duplicate, and destructive delete actions.

Rich Text Formatting

Right-clicking a text area reveals Bold, Italic, and Underline checkbox items that toggle styles live, plus an alignment submenu and an insert-link action.

File Explorer

A file list with per-row extension badges. Right-clicking any row opens open, rename, download, get-info, and delete actions for that specific file.

Social Feed

Post cards with upvote/downvote controls that update the count live. A Report submenu with reason options and a mute-author destructive action complete the menu.

Task Board

Task rows with priority badges and status icons. The context menu exposes a status radio group, a priority submenu, reassign, archive, and delete — all updating the row in place.