Svelte Toolbar - Bitblue

Compose icon actions into a compact toolbar with groups and optional end content

Toolbar frames related icon actions. Nest ToolbarGroup for clusters and ToolbarButton for each control. Use the end snippet for trailing actions.

Setup

<script lang="ts">
	import { Toolbar, ToolbarButton, ToolbarGroup } from '.';
</script>

Default

<script lang="ts">
	import { Toolbar, ToolbarButton, ToolbarGroup } from '.';
</script>

<Toolbar>
	<ToolbarGroup>
		<ToolbarButton name="Edit" aria-label="Edit">…</ToolbarButton>
		<ToolbarButton name="Duplicate" aria-label="Duplicate">…</ToolbarButton>
	</ToolbarGroup>
</Toolbar>

Colors

<script lang="ts">
	import { Toolbar, ToolbarButton, ToolbarGroup } from '.';
</script>

<Toolbar color="primary">
	<ToolbarGroup>
		<ToolbarButton color="primary" aria-label="Bold">B</ToolbarButton>
	</ToolbarGroup>
</Toolbar>

Embedded

embedded removes the framed background so the toolbar can sit inside another surface.

<Toolbar embedded>
	<ToolbarGroup>
		<ToolbarButton aria-label="Cut">Cut</ToolbarButton>
		<ToolbarButton aria-label="Copy">Copy</ToolbarButton>
	</ToolbarGroup>
</Toolbar>

End snippet

Place secondary actions on the right with {#snippet end()}.

<script lang="ts">
	import { Toolbar, ToolbarButton, ToolbarGroup, Button } from '.';
</script>

<Toolbar>
	<ToolbarGroup>
		<ToolbarButton aria-label="Format">Format</ToolbarButton>
	</ToolbarGroup>
	{#snippet end()}
		<Button size="xs" color="alternative">Save</Button>
	{/snippet}
</Toolbar>

Multiple groups

<script lang="ts">
	import { Toolbar, ToolbarButton, ToolbarGroup } from '.';
</script>

<Toolbar>
	<ToolbarGroup position="first">
		<ToolbarButton aria-label="Align left">Left</ToolbarButton>
	</ToolbarGroup>
	<ToolbarGroup position="last">
		<ToolbarButton color="red" aria-label="Delete">Delete</ToolbarButton>
	</ToolbarGroup>
</Toolbar>

As link

ToolbarButton accepts href to render as an anchor.

Props

Toolbar

PropTypeDefaultDescription
childrenSnippet—Leading groups / buttons
endSnippet—Trailing content aligned to the end
color'default' | 'primary' | 'secondary' | 'gray' | 'red' | 'yellow' | 'green' | 'indigo' | 'purple' | 'pink' | 'blue' | 'dark''default'Frame background / divider color
embeddedboolean—Transparent, unframed toolbar
class / classestheme slots—Root / content slot overrides
...restHTMLAttributes<HTMLDivElement>—Root attributes (color omitted from HTML)

ToolbarGroup

PropTypeDefaultDescription
spacing'default' | 'tight' | 'loose''default'Gap between buttons
padding'default' | 'none''default'Horizontal padding between groups
position'middle' | 'first' | 'last'—Edge padding tweaks
...restHTMLAttributes<HTMLDivElement>—Root attributes

ToolbarButton

PropTypeDefaultDescription
namestring—Optional accessible name
colorbutton color token'default'Hover / text color
size'xs' | 'sm' | 'md' | 'lg''md'Padding and ring size
backgroundboolean—Dark hover background variant
hrefstring—Render as link when set
...restbutton or anchor attrs—onclick, aria-label, etc.

© 2026 Bitblue is a registered trademark. All Rights Reserved.