View as Markdown

API reference: @salmonui/navigation/sidebar-menu

SidebarMenuIteminterface

import type { SidebarMenuItem } from '@salmonui/navigation/sidebar-menu';
interface SidebarMenuItem {
    readonly id: string;
    readonly label: ReactNode;
    readonly textValue?: string | undefined;
    readonly icon?: ReactNode;
    readonly href?: string | undefined;
    readonly children?: readonly SidebarMenuItem[] | undefined;
    readonly disabled?: boolean | undefined;
    readonly badge?: ReactNode;
    readonly type?: 'item' | undefined;
}

A link, an action or a submenu.

SidebarMenuItem members (9)
NameSignatureDescription
idreadonly id: string;

Stable, unique id (the selection and expansion key).

labelreadonly label: ReactNode;
textValueoptionalreadonly textValue?: string | undefined;

Plain text of label when it is not a string: the rail fallback icon and development messages.

iconoptionalreadonly icon?: ReactNode;

Decorative icon (aria-hidden); in the collapsed rail it is all that shows.

hrefoptionalreadonly href?: string | undefined;

Renders a link (through renderLink when given). Ignored on an item with children.

childrenoptionalreadonly children?: readonly SidebarMenuItem[] | undefined;

Nested items: the item becomes a disclosure button for a submenu.

disabledoptionalreadonly disabled?: boolean | undefined;
badgeoptionalreadonly badge?: ReactNode;

Trailing content (a count, a status dot); part of the accessible name.

typeoptionalreadonly type?: 'item' | undefined;