Skip to content

menuButton

menuButton(opts): void

Defined in: components/menu.ts:351

A button that opens a floating dropdown menu on click. Keyboard navigation: Arrow Up/Down, Home, End; Escape/Tab to close; Enter/Space activate the focused item natively.

Tip: set href on items and call interceptLinks() once at app startup for SPA navigation — active items are highlighted automatically.

MenuOptions

void

S.menuButton({
button: { content: "Actions", attrs: ".neutral" },
items: [
{ label: "Edit", icon: () => A("#✎"), click: () => edit() },
{ separator: true },
{ label: "Delete", attrs: "fg:$s-danger", click: () => del() },
],
});