Toolbar
Bar buttons, grouped the way iOS 26 groups them on one Liquid Glass capsule, for the Navigation Bar and for a bar of actions along the bottom of the screen.
Installation
Usage
Put a <ui-toolbar> after the screen's <scroll-view>, and ui-bar-scroll on the scroll view so the content ends above it:
- The toolbar floats over the content at the bottom of the screen, above the home indicator. Content scrolls beneath it, and on iOS 26 fades out as it does.
- Items spread across it. A
<ui-toolbar-spacer>takes the free space instead, pushing what follows it to the end. - Every item needs a
label. It's what a screen reader says, and what the item shows without an icon.
What each platform draws
Groups
<ui-toolbar-group> puts related items on one glass capsule, as iOS 26 groups a bar's items. Before iOS 26 and on Android it only keeps them together.
- An item on its own is a glass circle for an icon, or a capsule for a label.
- Keep labels apart from icons. Side by side on one capsule, they read as one button.
- Aim for three groups at most in a bar, as Apple suggests.
Prominent items
prominent marks the screen's key action, such as Done: tinted glass on iOS 26, a bold label before it, and a filled button on Android. Give it a place of its own at the trailing end; in a group it's a plain item.
Back items
back draws the platform's Back button: a glass circle with a chevron on iOS 26, the chevron and label before it, and Material's arrow on Android. The Navigation Bar shows one by itself; use this one for a Back button of your own.
Your own icon
For an action the icon set has nothing for, pass your own icon's markup to svg instead of icon:
currentColortakes the item's color for its design, as the set's icons do: the glass's foreground on iOS 26, the tint color before, and the tint's foreground on a prominent item. Colors written out stay.xmlnsis optional, and lines must be<path>s, as for an icon's own SVG.- Give
iconorsvg, not both. A Back item draws the platform's chevron whatever it's given.
The scroll view
ui-bar-scroll on a <scroll-view> or a <list> is what connects the content to the bars over it:
- It makes room for the navigation bar and the status bar at the top, and the toolbar and the home indicator at the bottom.
- It draws the large title of a navigation bar with
largeTitle, as a button when the bar has a title menu, with an element markedlargeTitleAccessorybeside it. - It fades content out under glass bars, iOS 26's scroll edge effect. Android's scroll view takes no mask, so there the glass bars fade content to the theme's
backgroundcolor themselves. - It tells the bars where the content is: the frosted bars turn opaque, and Material's top app bar changes color, as content scrolls under them.
It reads the scroll view's events itself rather than through a template listener, so it updates the bars only when they change.
A long feed is a <list>, which takes it too. Everything in a list is a list item, so the room for the bars and the large title are items of their own, before the list's items and after them, each a whole row of a flow or waterfall list (full-span). Their keys are ui-bar-scroll-top, ui-bar-scroll-large-title and ui-bar-scroll-bottom (BAR_SCROLL_ITEM_KEYS), so don't give your items those. A list sends scroll every 200 ms by default, which would bring the large title into the bar late, so it sends it about every frame unless you set scroll-event-throttle yourself:
API
UiToolbarItem
UiToolbar, UiToolbarGroup and UiToolbarSpacer
UiBarScroll and UiBarState
Accessibility
- Each item is one button, named by its
label. A disabled item also has thedisabledtrait. - Reduce Motion: the web preview's glass stops swelling under the finger, and the item shows a highlight instead. iOS calms its own glass.
- Reduce Transparency and Increase Contrast are handled by the glass.
Related
- Navigation Bar: the bar at the top of a screen, with a title and a Back button
- Button Group: a group of glass buttons inside a screen's content
- Dock: a floating glass tab bar for the app's top-level screens
- Glass: the glass the items are drawn with
