Toolbar
A row of grouped controls with a toolbar role and roving keyboard focus.
Show codeHide code
Installation
import {
Toolbar,
ToolbarButton,
ToolbarGroup,
ToolbarInput,
ToolbarLink,
ToolbarMenuTrigger,
ToolbarSeparator,
ToolbarToggle,
ToolbarToggleGroup,
} from "@makeplane/propel/components/toolbar";Usage
import { Icon } from "@makeplane/propel/components/icon";
import { Menu, MenuContent, MenuItem } from "@makeplane/propel/components/menu";
import {
Toolbar,
ToolbarButton,
ToolbarGroup,
ToolbarMenuTrigger,
ToolbarSeparator,
ToolbarToggle,
ToolbarToggleGroup,
} from "@makeplane/propel/components/toolbar";
import {
AlignCenterOutline,
AlignLeftOutline,
AlignRightOutline,
BoldOutline,
CodeOutline,
ImageOutline,
ItalicOutline,
LinkOutline,
ListOutline,
ToggleListOutline,
NumberedListOutline,
ChatOutline,
QuoteOutline,
StrikethroughOutline,
TableEditorOutline,
UnderlineOutline,
} from "@makeplane/propel/icons";
const TEXT_STYLES = ["Paragraph", "Heading 1", "Heading 2", "Heading 3"];
const FONTS = ["Sans", "Serif", "Mono"];
export default function BasicDemo() {
return (
<Toolbar elevation="raised" size="sm" aria-label="Formatting">
<Menu>
<ToolbarMenuTrigger aria-label="Text style" label="Text" />
<MenuContent>
{TEXT_STYLES.map((style) => (
<MenuItem key={style} label={style} />
))}
</MenuContent>
</Menu>
<Menu>
<ToolbarMenuTrigger aria-label="Font" label="Aa" />
<MenuContent>
{FONTS.map((font) => (
<MenuItem key={font} label={font} />
))}
</MenuContent>
</Menu>
<ToolbarButton aria-label="Comment" icon={<Icon icon={ChatOutline} />} />
<ToolbarSeparator />
<ToolbarGroup aria-label="Text formatting">
<ToolbarToggle aria-label="Bold" icon={<Icon icon={BoldOutline} />} />
<ToolbarToggle aria-label="Italic" icon={<Icon icon={ItalicOutline} />} />
<ToolbarToggle aria-label="Underline" icon={<Icon icon={UnderlineOutline} />} />
<ToolbarToggle aria-label="Strikethrough" icon={<Icon icon={StrikethroughOutline} />} />
</ToolbarGroup>
<ToolbarSeparator />
<ToolbarToggleGroup defaultValue={["left"]} aria-label="Text alignment">
<ToolbarToggle
value="left"
aria-label="Align left"
icon={<Icon icon={AlignLeftOutline} />}
/>
<ToolbarToggle
value="center"
aria-label="Align center"
icon={<Icon icon={AlignCenterOutline} />}
/>
<ToolbarToggle
value="right"
aria-label="Align right"
icon={<Icon icon={AlignRightOutline} />}
/>
</ToolbarToggleGroup>
<ToolbarSeparator />
<ToolbarGroup aria-label="Lists">
<ToolbarToggle aria-label="Bullet list" icon={<Icon icon={ListOutline} />} />
<ToolbarToggle aria-label="Numbered list" icon={<Icon icon={NumberedListOutline} />} />
<ToolbarToggle aria-label="Checklist" icon={<Icon icon={ToggleListOutline} />} />
</ToolbarGroup>
<ToolbarSeparator />
<ToolbarGroup aria-label="Blocks">
<ToolbarToggle aria-label="Quote" icon={<Icon icon={QuoteOutline} />} />
<ToolbarToggle aria-label="Code block" icon={<Icon icon={CodeOutline} />} />
<ToolbarButton aria-label="Insert table" icon={<Icon icon={TableEditorOutline} />} />
</ToolbarGroup>
<ToolbarSeparator />
<ToolbarButton aria-label="Insert link" icon={<Icon icon={LinkOutline} />} />
<ToolbarButton aria-label="Insert image" icon={<Icon icon={ImageOutline} />} />
</Toolbar>
);
}Examples
Elevations
raised draws its own card (border and shadow) so the toolbar can float over content; flat draws no surface and sits flush inside an existing bar.
Show codeHide code
Sizes
size sets the control hit targets: sm packs them to 24px, md gives them 28px. Orthogonal to elevation. Figma’s density maps here — compact → sm, comfortable → md (raised floaters use sm).
Show codeHide code
With filter
ToolbarInput is an inline filter box that joins the roving tab order, its height tracking the toolbar’s size like every other item.
Show codeHide code
With link
ToolbarLink is a toolbar item that navigates — an <a> sharing the same roving tab order and icon chrome as the buttons around it. Its required icon takes the bare glyph, so name it with aria-label.
Show codeHide code
With labels
ToolbarButton, ToolbarToggle, and ToolbarLink take an optional label after the icon (e.g. “Comment”, “Link”): the square icon box widens to hug icon + text, with the size’s gap and side padding. The visible label names the control; icon-only items still take aria-label.
Show codeHide code
With tooltips
Toolbar controls are usually icon-only, so pair each with a Tooltip naming it (plus a dimmed shortcut hint). A shared TooltipProvider keeps open and close timing consistent across the bar.
Show codeHide code
API Reference
Toolbar
The ready-made toolbar: grafts Base UI's Toolbar.Root behavior (the toolbar role + roving
focus, plus disabled / loopFocus) onto the styled horizontal elements/toolbar row and
shares its size with the controls inside via context (so each control packs to match).
ToolbarGroup
Groups related controls: grafts Base UI's Toolbar.Group behavior (the group role + group
disabled) onto the styled ToolbarGroup cluster. The group shares the toolbar row's gap-2
per Figma, so it is a semantic grouping — pair it with ToolbarSeparators to make it visible.
ToolbarSeparator
A thin vertical rule that visually divides one cluster of controls from the next: grafts Base
UI's Toolbar.Separator behavior (the separator role) onto the styled rule.
ToolbarButton
A toolbar action button: grafts Base UI's Toolbar.Button (roving-focus item) behavior onto the
styled ToolbarButton, taking its size from the surrounding Toolbar via context.
ToolbarToggle
A two-state toolbar button for formatting toggles like bold or italic. Grafts Base UI's
Toolbar.Button (roving-focus item) and Toggle (pressed state) behaviors onto the styled
ToolbarButton, and takes its size from the surrounding Toolbar via context.
ToolbarToggleGroup
A cluster of ToolbarToggles sharing one selection: grafts Base UI Toolbar.Group (toolbar
group semantics + group disabled) and ToggleGroup (value state) onto the styled toggle-group
container. Drive it with value/defaultValue + onValueChange. An aria-label is required.
ToolbarLink
A toolbar item that navigates — Base UI's Toolbar.Link (<a> in the roving tab order) grafted
onto the toolbar item chrome. Pass an icon element, e.g. <Icon icon={ExternalLink} />. An
aria-label is required when the item is icon-only.
ToolbarInput
An inline text input in the toolbar's roving tab order (e.g. a filter box) — Base UI's
Toolbar.Input grafted onto the styled miniature field, its height tracking the toolbar's size.
An aria-label is required.
ToolbarMenuTrigger
The trigger that opens a ToolbarMenu: a label plus a disclosure chevron.