Menu
An action menu on a trigger button. Arrow keys, Home, End and typing move a soft highlight that slides between rows; Escape closes and returns focus to the trigger.
pixikit.com/docs/components/menu
Customize
Default open
Placement
Offset6px
Width232px
Close on select
Portal
Props
13| Name | Type | Default | Description |
|---|---|---|---|
trigger | ReactNode | "Menu" | What the trigger button shows. The button is owned by the menu. |
items | MenuEntry[] | Required | The rows, separators and labels, in order. |
open | boolean | None | Whether the menu is open, when you hold the state. |
defaultOpen | boolean | None | Whether the menu is open at first, when the menu holds the state. |
onOpenChange | (open: boolean) => void | None | Called with the next open state. |
placement | Placement | "bottom-start" | Where the menu sits around the trigger; it flips when there is no room. |
offset | number | 6 | Gap in px between the trigger and the menu. |
header | ReactNode | None | Content above the rows, such as an account name. |
width | number | 224 | Width of the menu in px. |
closeOnSelect | boolean | true | Closes the menu after a row is chosen. |
portal | boolean | true | Renders the menu in a portal on the page body; turn off to keep it inline. |
className | string | None | Extra classes for the menu panel. |
triggerClassName | string | None | Extra classes for the trigger button. |