Panel Menu

Collects a panel's secondary actions behind a kebab trigger.

Configurations

Supported configurations for this component.

Default

Interaction states covered by the API and the style contract.

Configurations

3 examples
Closed
sm
md
lg
Open
sm
md
lg
With submenu
sm
md
lg

Default

1 example
Rest
Item selected

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

PanelMenuItem

PropTypeDefaultDescription
labelstring-Text shown for the menu item.
iconReact.ComponentType<{ size?: number, weight?: string }>-Icon rendered to the left of the label.
onSelect() => void-Handler called when the item is chosen (ignored on items with a submenu).
submenuPanelMenuItem[]-Nested items opened as a flyout submenu.
selectedboolean-Marks the item as the active choice, styling it accordingly.
destructiveboolean-Renders the item label in the destructive red color.
type'separator'-Set to 'separator' to render a divider rule instead of a clickable item.

PanelMenu

PropTypeDefaultDescription
itemsreqPanelMenuItem[]-Entries rendered in the menu, in order.
align'left'|'right''right'Edge of the trigger the menu aligns to.
size'sm'|'md'|'lg''md'Trigger size, forwarded straight to IconButton. `md` is the panel-header default. Drop to `sm` when the menu is a per-row overflow inside a dense table, where a 32px square would set the row height. The rows follow the same rung as the trigger.
ariaLabelstring'Panel options'Accessible label for the kebab trigger button and menu.
defaultOpenbooleanfalseRender the menu pre-opened. Useful in showcases / docs so the consumer can see the menu contents without first having to click the trigger. Click-outside and Escape still dismiss it.
staticOpenbooleanfalseLike defaultOpen, but the menu stays open and renders inline under the trigger: the click-outside and Escape dismissers are not attached and the trigger cannot toggle it. For a page that documents the menu's contents; an overflow menu in an app must dismiss.
classNamestring-Extra class applied to the wrapper element.
styleReact.CSSProperties-Inline styles merged onto the wrapper element.

More Andromeda Pro components