View as Markdown

API reference: @salmonui/navigation/toolbar

ToolbarItemPropsinterface

import type { ToolbarItemProps } from '@salmonui/navigation/toolbar';
interface ToolbarItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
    readonly children?: ReactNode | ((size: ToolbarItemSize) => ReactNode);
    readonly sizes?: readonly ToolbarItemSize[] | undefined;
    readonly label?: string | undefined;
    readonly icon?: ReactNode;
    readonly overflow?: OverflowMode | undefined;
    readonly overflowPriority?: number | undefined;
}
ToolbarItemProps members (6)
NameSignatureDescription
childrenoptionalreadonly children?: ReactNode | ((size: ToolbarItemSize) => ReactNode);

Content, or a function of the item's current size (sizes).

sizesoptionalreadonly sizes?: readonly ToolbarItemSize[] | undefined;

Sizes the item may take, largest first ('lg' | 'md' | 'sm'). It renders sizes[0] until measured; with overflow="menu" it steps down by overflowPriority before anything overflows. Current size: data-size and the function child's argument ('md' without sizes).

labeloptionalreadonly label?: string | undefined;

Text of the item's overflow menu entry (default: the control's aria-label or text).

iconoptionalreadonly icon?: ReactNode;

Icon of the item's overflow menu entry.

overflowoptionalreadonly overflow?: OverflowMode | undefined;

'auto' overflows when space runs out, 'never' stays, 'always' lives in the overflow menu. Default 'auto', or 'never' for an item whose content is a form field (it cannot be a menu entry).

overflowPriorityoptionalreadonly overflowPriority?: number | undefined;

Higher stays longer (steps down and overflows later) when space runs out. Default 0.