Skip to content
GitHub11 stars

A container for grouping a set of buttons and controls.

<ToolbarRoot class="toolbar">
    <ToggleGroupRoot class="toolbar-group" aria-label="Alignment">
        <ToolbarButton aria-label="Align left" class="toolbar-button">

Usage guidelines

  • Use inputs sparingly: The left and right arrow keys both move the text cursor in an input and move between the controls of a horizontal toolbar. When a horizontal toolbar has an input, use only one, and make it the last control.

Anatomy

Import the primitives and assemble the parts:

@using Blazix.Primitives

<ToolbarRoot>
    <ToolbarButton />
    <ToolbarLink />
    <ToolbarSeparator />
    <ToolbarGroup>
        <ToolbarButton />
        <ToolbarButton />
    </ToolbarGroup>
    <ToolbarInput />
</ToolbarRoot>

API Reference

ToolbarRoot

Renders a <div> element.

ParameterTypeDefault
Disabled

Whether the component should ignore user interaction.

bool false
Orientation

Which way the parts are laid out, and which arrow keys move between them.

Orientation Orientation.Horizontal
LoopFocus bool true
Render RenderFragment<ToolbarRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the toolbar.

'horizontal' | 'vertical'
data-disabled

Present when the toolbar is disabled.

-

ToolbarInput

Renders a <input> element.

ParameterTypeDefault
Disabled

Whether the component should ignore user interaction.

bool false
FocusableWhenDisabled bool true
Render RenderFragment<ToolbarItemRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the toolbar.

'horizontal' | 'vertical'
data-disabled

Present when the input is disabled.

-
data-focusable

Present when the input remains focusable when disabled.

-

ToolbarGroup

Renders a <div> element.

ParameterTypeDefault
Disabled

Whether the component should ignore user interaction.

bool false
Render RenderFragment<ToolbarRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the toolbar.

'horizontal' | 'vertical'
data-disabled

Present when the group is disabled.

-

ToolbarSeparator

Renders a <div> element.

ParameterTypeDefault
Render RenderFragment<PartRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the separator, which is perpendicular to the toolbar.

'horizontal' | 'vertical'

ToolbarButton

Renders a <button> element.

ParameterTypeDefault
Disabled

Whether the component should ignore user interaction.

bool false
FocusableWhenDisabled bool true
NativeButton bool? -
Render RenderFragment<ToolbarItemRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the toolbar.

'horizontal' | 'vertical'
data-disabled

Present when the button is disabled.

-
data-focusable

Present when the button remains focusable when disabled.

-

Renders a <a> element.

ParameterTypeDefault
Render RenderFragment<ToolbarItemRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the toolbar.

'horizontal' | 'vertical'