# @salmonui/navigation/toolbar API reference

> 15 exported symbols of @salmonui/navigation/toolbar: 5 functions, 4 interfaces, 5 types and 1 constant.

Canonical: https://salmonui.dev/docs/reference/navigation/toolbar

```ts
import { … } from '@salmonui/navigation/toolbar';
```

## Functions

### Toolbar

Kind: function

Page: https://salmonui.dev/docs/reference/navigation/toolbar/Toolbar

```ts
function Toolbar(props: ToolbarProps): ReactElement;
```

APG Toolbar: `role="toolbar"` with one tab stop (Tab enters on the last
focused control, or the first), arrow keys by `orientation` (mirrored in
RTL), Home / End. `.salmon-toolbar` with `data-orientation`,
`data-overflow` and `data-disabled`.

### ToolbarGroup

Kind: function

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarGroup

```ts
function ToolbarGroup(props: ToolbarGroupProps): ReactElement;
```

A run of items aligned to the start, center or end of the bar
(`.salmon-toolbar-group` with `data-align`). Give it `aria-label` to expose
it as a named `role="group"`.

### ToolbarItem

Kind: function

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarItem

```ts
function ToolbarItem(props: ToolbarItemProps): ReactElement;
```

A measured toolbar slot around any content (`.salmon-toolbar-item`).
Direct children of `Toolbar` and `ToolbarGroup` that are not toolbar parts
are wrapped in one automatically.

### ToolbarSeparator

Kind: function

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarSeparator

```ts
function ToolbarSeparator(props: ToolbarSeparatorProps): ReactElement;
```

A visual and semantic separator between items (`role="separator"`); hidden when it would end up leading, trailing or doubled.

### ToolbarSpacer

Kind: function

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarSpacer

```ts
function ToolbarSpacer(props: ToolbarSpacerProps): ReactElement;
```

Flexible space: items after it go to the end of the bar.

## Interfaces

### ToolbarGroupProps

Kind: interface

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarGroupProps

```ts
interface ToolbarGroupProps extends HTMLAttributes<HTMLDivElement> {
    readonly children?: ReactNode;
    readonly align?: 'start' | 'center' | 'end' | undefined;
    readonly label?: ReactNode;
    readonly action?: ReactNode;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `children` | `readonly children?: ReactNode;` | optional |  |
| `align` | `readonly align?: 'start' \| 'center' \| 'end' \| undefined;` | optional | Pushes the group to the start, center or end of the bar. Default `'start'`. |
| `label` | `readonly label?: ReactNode;` | optional | Visible label under the items; names the group (`role="group"`). |
| `action` | `readonly action?: ReactNode;` | optional | Launcher slot next to the label (for example a `Button iconOnly`); never overflows. |

### ToolbarItemProps

Kind: interface

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarItemProps

```ts
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;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `children` | `readonly children?: ReactNode \| ((size: ToolbarItemSize) => ReactNode);` | optional | Content, or a function of the item's current size (`sizes`). |
| `sizes` | `readonly sizes?: readonly ToolbarItemSize[] \| undefined;` | optional | 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`). |
| `label` | `readonly label?: string \| undefined;` | optional | Text of the item's overflow menu entry (default: the control's `aria-label` or text). |
| `icon` | `readonly icon?: ReactNode;` | optional | Icon of the item's overflow menu entry. |
| `overflow` | `readonly overflow?: OverflowMode \| undefined;` | optional | `'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). |
| `overflowPriority` | `readonly overflowPriority?: number \| undefined;` | optional | Higher stays longer (steps down and overflows later) when space runs out. Default 0. |

### ToolbarLocaleText

Kind: interface

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarLocaleText

```ts
interface ToolbarLocaleText {
    readonly more: string;
    readonly scrollBack: string;
    readonly scrollForward: string;
}
```

User-visible strings of `Toolbar`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `more` | `readonly more: string;` |  | Name of the overflow menu button. |
| `scrollBack` | `readonly scrollBack: string;` |  | Scroll button toward the inline start (`overflow="scroll"`). |
| `scrollForward` | `readonly scrollForward: string;` |  | Scroll button toward the inline end (`overflow="scroll"`). |

### ToolbarProps

Kind: interface

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarProps

```ts
interface ToolbarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
    readonly children?: ReactNode;
    readonly orientation?: ToolbarOrientation | undefined;
    readonly overflow?: ToolbarOverflow | undefined;
    readonly scrollStep?: number | undefined;
    readonly disabled?: boolean | undefined;
    readonly moreIcon?: ReactNode;
    readonly localeText?: Partial<ToolbarLocaleText> | undefined;
    readonly ref?: Ref<HTMLDivElement> | undefined;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `children` | `readonly children?: ReactNode;` | optional | Toolbar content: buttons, `ToolbarItem`, `ToolbarGroup`, `ToolbarSpacer`, `ToolbarSeparator`. |
| `orientation` | `readonly orientation?: ToolbarOrientation \| undefined;` | optional | Layout and arrow-key axis. Default `'horizontal'`. |
| `overflow` | `readonly overflow?: ToolbarOverflow \| undefined;` | optional | What happens to items that do not fit. Default `'menu'`. |
| `scrollStep` | `readonly scrollStep?: number \| undefined;` | optional | Distance of one scroll-button press in px (`overflow="scroll"`). Default 120. |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional | Disables every control (a disabled `<fieldset>`); `aria-disabled` on the toolbar. |
| `moreIcon` | `readonly moreIcon?: ReactNode;` | optional | Icon of the overflow menu button (default: three dots). |
| `localeText` | `readonly localeText?: Partial<ToolbarLocaleText> \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<HTMLDivElement> \| undefined;` | optional |  |

## Types

### ToolbarItemSize

Kind: type

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarItemSize

```ts
type ToolbarItemSize = 'lg' | 'md' | 'sm';
```

### ToolbarOrientation

Kind: type

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarOrientation

```ts
type ToolbarOrientation = 'horizontal' | 'vertical';
```

### ToolbarOverflow

Kind: type

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarOverflow

```ts
type ToolbarOverflow = 'menu' | 'scroll' | 'wrap';
```

### ToolbarSeparatorProps

Kind: type

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarSeparatorProps

```ts
type ToolbarSeparatorProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'>;
```

### ToolbarSpacerProps

Kind: type

Page: https://salmonui.dev/docs/reference/navigation/toolbar/ToolbarSpacerProps

```ts
type ToolbarSpacerProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
```

## Constants

### TOOLBAR_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/navigation/toolbar/TOOLBAR_DEFAULT_LOCALE_TEXT

```ts
const TOOLBAR_DEFAULT_LOCALE_TEXT: ToolbarLocaleText;
```
