AsterUIDocsv1.0.2

Docs / Component reference

Menubar

Group application commands under short menu names. Open a menu to see the choices and their shortcut labels.

Menubar example

Install

sh
npx @fierst/ui@1.0.2 add menubar

Registry dependencies: theme.

Exports from ./ui/menubar: MenubarMenu, Menubar.

Download the registry source for menubar 1.0.2.

API contracts

ts
export interface MenubarMenu {
  id: string;
  label: string;
  items: readonly {
    id: string;
    label: string;
    shortcut?: string;
    disabled?: boolean;
    separatorBefore?: boolean;
    onSelect: () => void;
  }[];
}

export function* Menubar(
  props: {
    menus: readonly MenubarMenu[];
    label?: string;
    class?: string;
  },
  ctx: Ctx,
)