Skip to content

MenuItem

Defined in: components/menu.ts:14

A clickable item in a menu or sidebar nav.

Tip: set href and call Aberdeen’s interceptLinks() once at app startup for SPA-style navigation. When href is set, the item is automatically highlighted as active whenever the current URL matches it (via matchCurrent).

label: Slot

Defined in: components/menu.ts:16

Label text or draw function. Strings are rendered as rich text.


optional icon?: Slot

Defined in: components/menu.ts:18

Leading icon drawn before the label.


optional click?: (e) => void

Defined in: components/menu.ts:20

Click handler.

Event

void


optional href?: string

Defined in: components/menu.ts:26

Render as a link (<a>) pointing here. Pairs naturally with interceptLinks() — the item is highlighted automatically when the URL matches.


optional target?: string

Defined in: components/menu.ts:28

target for the link (_blank, etc.). Only meaningful with href.


optional disabled?: boolean

Defined in: components/menu.ts:30

Disables the item.


optional attrs?: string

Defined in: components/menu.ts:32

Aberdeen attr/style string on the item element.