Toolbar

Floating commands on Liquid Glass.

  • Composed
  • Liquid Glass on iOS 26
  • In the first release
import { Toolbar, GlassSurface, glassSurfacePrimitive, toolbarActionPrimitive, toolbarPrimitive } from "nitro-ui-sdk/glass-surface";
HeroUI Native
GlassViewThemeBackground
Expo UI
ToolbarHorizontalFloatingToolbarControlGroup
  • Toolbar example screen, light appearance
    Light
  • Toolbar example screen, dark appearance
    Dark
  • Toolbar example screen, liquid glass appearance
    Liquid Glass
On this page

Toolbar is a row of floating commands on Liquid Glass, like the bars of iOS 26: back and close on the leading side, a title in the middle, grouped actions and a prominent Done on the trailing side. Each group and each lone action sits on its own glass capsule, and a glass container merges capsules that come close. When glass is off the same shapes use the opaque token fallback.

GlassSurface (same entry point) is a free-form piece of the same material for other floating chrome: a player bar, a map control. Glass belongs to the navigation layer; keep body text on Card or Surface instead.

Anatomy

import { GlassSurface, Toolbar } from "nitro-ui-sdk/glass-surface";

<Toolbar.Root>
  <Toolbar.Leading>
    <Toolbar.Action symbol="chevron.left" label="Back" onPress={() => {}} />
  </Toolbar.Leading>
  <Toolbar.Title>Inbox</Toolbar.Title>
  <Toolbar.Trailing>
    <Toolbar.Group>
      <Toolbar.Action symbol="square.and.arrow.up" label="Share" onPress={() => {}} />
      <Toolbar.Action symbol="pencil" label="Edit" onPress={() => {}} />
    </Toolbar.Group>
    <Toolbar.Action label="Done" prominent onPress={() => {}} />
  </Toolbar.Trailing>
</Toolbar.Root>;

<GlassSurface />;
Part Description
Root The row, inside a MaterialGroup so nearby glass merges. With bar, one capsule behind everything.
Leading / Trailing Rows of actions at either end.
Title The centered (or leading) title with an optional subtitle; a heading for VoiceOver. It sits on content, never on glass.
Spacer Takes the free width, e.g. between leading and trailing actions without a title.
Group Several actions on one capsule.
Action One command: an SF Symbol or a text label. Alone it gets its own glass circle; inside a group it shares the capsule.
GlassSurface A free-form glass container with a token radius and padding.

Usage

import { Toolbar } from "nitro-ui-sdk/glass-surface";

<Toolbar.Root>
  <Toolbar.Leading>
    <Toolbar.Action symbol="chevron.left" label="Back" onPress={() => {}} />
  </Toolbar.Leading>
  <Toolbar.Title>Inbox</Toolbar.Title>
  <Toolbar.Trailing>
    <Toolbar.Action label="Done" prominent onPress={() => {}} />
  </Toolbar.Trailing>
</Toolbar.Root>;

Variants and sizes

Variant Look
regular Liquid Glass, the regular effect.
clear The more transparent glass, for vivid media behind it.
solid Always opaque: overlay with a border, or the accent fill for a prominent action.

Sizes sm | md | lg (default md) set the capsule height (44, 48, 52 pt) and the symbol size (17, 19, 21). Every action keeps at least a 44 pt target. bar draws one capsule behind the whole toolbar instead of one per group or action.

The named sizes compact and regular map to sm and md.

import { Toolbar } from "nitro-ui-sdk/glass-surface";

<Toolbar.Root variant="clear" size="lg" bar>
  <Toolbar.Action symbol="backward.fill" label="Previous" onPress={() => {}} />
  <Toolbar.Spacer />
  <Toolbar.Action symbol="play.fill" label="Play" onPress={() => {}} />
  <Toolbar.Spacer />
  <Toolbar.Action symbol="forward.fill" label="Next" onPress={() => {}} />
</Toolbar.Root>;

States

  • Disabled action: opacity.disabled, no press from touch, VoiceOver, the agent or the controller.
  • Prominent action: its own capsule uses the accent tint or fill with accentForeground content. In a shared capsule the label or icon uses foreground, with semibold weight for text.
  • Pressed: interactive glass reacts to touch natively; the opaque fallback dims like other Semantics controls.

Liquid Glass

Glass is drawn when the theme draws it (theme.material === "glass": requested, iOS 26 or later, transparency not reduced) and the variant is not solid (toolbarPaintsGlass(variant, material)). Enabled lone actions use interactive glass, groups use a capsule, and Root wraps everything in a MaterialGroup (spacing spacing.sm) so adjacent shapes merge. Without glass, every capsule becomes the opaque overlay fill with a border, and a prominent action the accent fill, so labels stay legible.

import { GlassSurface } from "nitro-ui-sdk/glass-surface";
import { Text } from "nitro-ui-sdk/text";

<GlassSurface variant="clear" radius="xl" padding="md" interactive>
  <Text variant="headline">Now playing</Text>
</GlassSurface>;

Props

Toolbar.Root

Prop Type Default Description
variant "regular" | "clear" | "solid" "regular" Material.
size ToolbarSize | "compact" | "regular" "md" Capsule height.
title string Title shown when there are no children.
bar boolean false One capsule behind the whole toolbar.
styles ToolbarStyles Per-part style resolvers.
layout LayoutStyleProps Layout of the row.
children ReactNode Toolbar parts.

Toolbar.Title

Prop Type Default Description
children string The title.
subtitle string A caption line under the title.
align "center" | "leading" "center" Title alignment.
part ToolbarPart "title" Resolve another part’s style.

Toolbar.Leading, Toolbar.Trailing, Toolbar.Group

Prop Type Default Description
part ToolbarPart the part’s own name Resolve another part’s style.
children ReactNode Actions.

Toolbar.Action

Prop Type Default Description
label string Required. The spoken and agent name; the visible text when there is no symbol.
onPress (details: ActionDetails) => void Required.
symbol string SF Symbol.
prominent boolean false The bar’s primary action. Gives a lone action an accent capsule. Grouped actions use the capsule’s foreground.
disabled boolean false Blocks every press path.
hint string VoiceOver hint.
haptic HapticStyle | "none" "light" Impact felt on a touch press.
api Controller<ToolbarActionActions> From toolbarActionPrimitive.createApi().
agentId string label Agent identity.
confirm Confirmation Localized confirmation the agent must pass.
part ToolbarPart "action" Resolve another part’s style.

GlassSurface

Prop Type Default Description
variant "regular" | "clear" | "solid" "regular" Material.
radius RadiusToken "card" Corner radius token.
padding SpacingToken "lg" Inner padding token.
interactive boolean false The glass reacts to touch; put the labeled control inside.
styles GlassSurfaceStyles Style resolver for the surface root.
layout LayoutStyleProps Layout.
children ReactNode Content.

Controller API

Each action has its own controller:

import { useState } from "react";
import { Button } from "nitro-ui-sdk/button";
import { Toolbar, toolbarActionPrimitive } from "nitro-ui-sdk/glass-surface";

export function ShareToolbar() {
  const [share] = useState(() => toolbarActionPrimitive.createApi());
  return (
    <>
      <Toolbar.Root>
        <Toolbar.Action symbol="square.and.arrow.up" label="Share" onPress={() => {}} api={share} />
      </Toolbar.Root>
      <Button.Root label="Share from the controller" onPress={() => { share.current?.press(); }} />
    </>
  );
}
Action Signature Result
press press(source?: ActionSource): ActionStatus accepted, disabled, refused or unavailable.

Toolbar.Root and GlassSurface have no controller.

Styles

import { Toolbar, type ToolbarStyles } from "nitro-ui-sdk/glass-surface";

const styles: ToolbarStyles = {
  title: ({ tokens, size }) => ({ text: { color: tokens.colors.accent, numberOfLines: size === "sm" ? 1 : 2 } }),
  action: ({ tokens, state }) => ({ style: { opacity: state.disabled ? 0.3 : 1 } }),
};
<Toolbar.Root styles={styles} />;

Parts: root, leading, title, subtitle, trailing, group, action, actionLabel. Resolvers receive { tokens, variant, size, state } with state: { glass: boolean; disabled: boolean; prominent: boolean; grouped: boolean }. Custom children opt in with useToolbarPart(props, "title").

The standalone GlassSurface resolves the root part at size md. Its state contains glass, interactive, radius and padding.

Accessibility

  • Each action is a button named by label (icon-only actions show nothing else, so label is required), with hint and the disabled trait.
  • Title is a heading; with a subtitle it reads “Title, subtitle”.
  • Glass carries no semantics. GlassSurface is not an accessibility element; label the controls inside it.
  • Only a touch press plays the haptic.

Agent API

Action Arguments Notes
press none Per action: component ToolbarAction, role button, named by label. Asks for confirm when set.

Toolbar.Root, Title and GlassSurface are read-only and add no entry.

Platform notes

iOS Android
Toolbar Composed: MaterialGroup, MaterialView capsules and Semantics buttons; verified in the iOS harness. Same composition with the opaque fallback; written, compile-only on this machine.
Glass Liquid Glass on iOS 26+ (nitro-ui-glass), opaque fallback when off, unsupported or transparency is reduced. Opaque fallback.