Toolbar

A container for grouping related actions or controls.

Installation

Install the component package, shared coss-svelte theme, and Bits UI peer.

npm install coss-svelte @coss-svelte/theme bits-ui

Usage

Import the Svelte component exports directly from the package.

import { Toolbar, ToolbarButton, ToolbarGroup, ToolbarGroupItem, ToolbarLink, ToolbarSeparator } from "coss-svelte";

Anatomy

  • Toolbar
  • ToolbarButton
  • ToolbarGroup
  • ToolbarGroupItem
  • ToolbarLink
  • ToolbarSeparator

API Reference

Toolbar

A container for grouping related actions or controls.

PropTypeDefaultDescription
orientationOrientation"horizontal"Layout direction for the component.
children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI Toolbar.Root.

ToolbarButton

Renders a button-shaped control for the parent component.

children : Snippet<[]>child : Snippet<[{ props: Record<string, unknown> }]>bind:ref : HTMLElement | null

Inherits from Bits UI Toolbar.Button.

ToolbarGroup

Groups related items inside the parent component.

PropTypeDefaultDescription
type"single" | "multiple""button"Behavior, selection, or HTML type passed to the underlying control.
bind:valuestring | string[]""Current value for the component. Bind with `bind:value` when supported.
children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI Toolbar.Group.

ToolbarGroupItem

Renders one item inside a toolbar group.

children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI Toolbar.GroupItem.

ToolbarSeparator

Visually separates related content.

PropTypeDefaultDescription
orientation"horizontal" | "vertical""vertical"Layout direction for the component.
children : Snippet<[]>

Inherits from Svelte <span> attributes.

Implementation Details

Status
Stable
Foundation
bits
Category
Layout & Navigation
Particles
1