Component docs
Loading
"use client";
import { Menubar } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly MenubarItem[] | — | Items to render. |
onAction | (id: string) => void | — | Called with the id of the activated command (any leaf item). |
onValueChange | (value: string) => void | — | Called with the new value (only when it changes). |
value | string | — | Marks the current top-level item (data-state="selected"), e.g. the app section; a display prop like aria-current, owned by your app. |
itemsrequiredreadonly MenubarItem[]
Items to render.
onAction(id: string) => void
Called with the id of the activated command (any leaf item).
onValueChange(value: string) => void
Called with the new value (only when it changes).
valuestring
Marks the current top-level item (data-state="selected"), e.g. the app section; a display prop like aria-current, owned by your app.
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const items = [
{ id: "file", label: "File", items: [{ id: "new", label: "New" }] },
{ id: "edit", label: "Edit", items: [{ id: "undo", label: "Undo" }] },
];
<Menubar items={items} />