Toolbar
This component's API and documentation are under review and may change. Use with caution in production.
Toolbar is a compound component for creating action bars anchored to any edge. It builds on Card for visual styling and provides structured slots for content organization.
Use Toolbar inside dialogs, popovers, panels, or any container where you need persistent controls.
Installation
shellUsage
tsxToolbar uses absolute positioning to span edge-to-edge. Use --rt-toolbar-height (or --rt-toolbar-width for vertical toolbars) to add padding to your content.
Anatomy
Toolbar is a compound component with the following parts:
tsxProps
Root Props
The root component manages positioning and inherits Card's visual styling.
Section Props
Toolbar.Left, Toolbar.Center, and Toolbar.Right extend Flex and accept all Flex props. They are placed on a CSS grid for true centering regardless of content width.
Plus all other Flex props (direction, wrap, p, m, etc.).
Title Props
Toolbar.Title renders a truncated heading and accepts all Heading props with toolbar-appropriate defaults.
Anchor
Use the anchor prop to position the toolbar at different edges.
Top
The default. Anchors to the top of the scroll container.
tsxBottom
Anchors to the bottom, useful for action bars.
tsxLeft / Right
Vertical toolbars for sidebar-style controls.
tsxPositioning Modes
Toolbar has two positioning modes: inset (default) and floating. Both use position: absolute.
Inset (Default)
By default, Toolbar uses inset mode to go edge-to-edge inside Cards.
tsxWhen inset (default):
- No border radius
- Edge-to-edge layout
- Only the exposed edge shows a border
Floating
Use floating for a detached look with margin from edges.
tsxWhen floating:
- Full border radius from Card
- Margin from container edges (controlled by
offset) - Complete Card styling (all borders visible)
Offset
Control the margin when floating with the offset prop.
tsxVariants
Toolbar inherits all Card variants. The default is ghost for minimal visual weight.
Soft
Muted background, great for dialog headers.
tsxSurface
Subtle background with border. Good for floating toolbars.
tsxGhost
No visible background or border. Use when the parent provides visual context.
tsxSizes
Controls padding inside the toolbar.
tsxMaterial
Use material="translucent" for backdrop blur over images or dynamic backgrounds.
tsxCSS Variables
Toolbar exposes dimension variables so you can add padding to prevent content overlap:
--rt-toolbar-heightfor horizontal toolbars (anchor="top"oranchor="bottom")--rt-toolbar-widthfor vertical toolbars (anchor="left"oranchor="right")
The variables are set on the Toolbar's parent element, so the Toolbar and content must share a common container:
tsxFor bottom-anchored toolbars, use pb="var(--rt-toolbar-height)" on your content instead.
For image or video backgrounds where content should flow behind the toolbar, simply don't apply the padding.
Accessibility
- Use semantic elements and ARIA attributes as needed
- For dialog/popover context, pair with appropriate
aria-labelledbyon the container - Toolbar.Title can provide the ID for accessible labeling
tsx