For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /dolan/navigation-bar.md.

Navigation Bar

The bar at the top of a screen: its title, a Back button that goes back through the router, and the screen's actions. On iOS 26 its controls float in Liquid Glass, and content fades as it scrolls beneath them.

Installation

npx @blotch/dolan add navigation-bar
import { UiNavigationBar } from '../components/ui/navigation-bar';
import {
  UiBarScroll,
  UiToolbarGroup,
  UiToolbarItem,
} from '../components/ui/toolbar';
Tip

This also adds Toolbar, whose items and groups go in the bar, Glass and Icon.

Usage

Put the bar after the screen's <scroll-view>, and ui-bar-scroll on the scroll view. A long feed's <list> takes it too:

src/app/notes.ts
import { Component } from '@angular/core';
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';
import { UiNavigationBar } from '../components/ui/navigation-bar';
import {
  UiBarScroll,
  UiToolbarGroup,
  UiToolbarItem,
} from '../components/ui/toolbar';

@Component({
  selector: 'app-notes',
  imports: [
    LYNX_ELEMENTS,
    UiBarScroll,
    UiNavigationBar,
    UiToolbarGroup,
    UiToolbarItem,
  ],
  host: { class: 'flex flex-1 flex-col' },
  template: `
    <scroll-view
      ui-bar-scroll
      scroll-orientation="vertical"
      class="h-full w-full"
    >
      <view class="flex-col gap-3 px-4 pb-4 flex">…</view>
    </scroll-view>

    <ui-navigation-bar title="Notes" largeTitle>
      <ui-toolbar-item leading label="Edit" (pressed)="edit()" />
      <ui-toolbar-group>
        <ui-toolbar-item icon="search" label="Search" (pressed)="search()" />
        <ui-toolbar-item icon="plus" label="New note" (pressed)="add()" />
      </ui-toolbar-group>
    </ui-navigation-bar>
  `,
})
export class Notes {}
  • The bar floats over the content at the top of the screen, below the status bar. Content scrolls beneath it.
  • ui-bar-scroll makes room for it: the content starts below the bar and the status bar, so you don't pad for either.
  • Items go at the trailing end. Add leading to put one after the Back button. Group related ones.
  • The title is the screen's heading for screen readers. Keep it short: Apple suggests under 15 characters.

What each platform draws

PlatformWhat you get
iOS 26 and laterNo bar background. The items float in Liquid Glass, grouped ones on one capsule, and the Back button is a glass circle. Content fades out as it scrolls under the bar.
iOS 15 to 25The navigation bar of that time: clear at the top of the content, and on the bars' chrome material with a hairline once content scrolls under it. Items are in the tint color.
AndroidMaterial 3's small top app bar, or center-aligned with titleCentered. It turns from the surface color to the surface container's as content scrolls under it.
Android, with provideGlass()The iOS 26 bar, drawn with Android's blur.
Web previewThe iOS 26 bar, drawn with WebGL.

The Back button

The bar shows a Back button while the router has a screen to go back to, and a tap calls Location.back(). The router then goes back as for the browser's back button, so guards such as canDeactivate still run. On the app's first screen there's no Back button.

<ui-navigation-bar
  [title]="note().title"
  backLabel="Notes"
  backRoute="/notes"
/>
  • backLabel is the previous screen's title. iOS 15 to 25 show it beside the chevron, and screen readers say it everywhere. It's Back by default.
  • backRoute is where Back goes when there's no history, such as a note the app opened on from a link. The Back button then shows anyway, and replaces the screen with that route.
  • backButtonHidden hides it, for a screen that starts a flow though there's history behind it, such as a tab's first screen in a Dock.

It needs provideRouter() from @blotch/angular-lynx, whose in-memory history knows whether there's a screen to go back to. For a Back button that does something else, set backButtonHidden and add your own as a leading item: back draws the platform's Back button.

<ui-navigation-bar title="Step 2" backButtonHidden>
  <ui-toolbar-item leading back label="Step 1" (pressed)="previousStep()" />
</ui-navigation-bar>

Large title

With largeTitle, the title starts large at the top of the content and scrolls away with it. Once it has gone under the bar, the bar shows the title instead:

<ui-navigation-bar title="Notes" largeTitle />

ui-bar-scroll draws the large title, so it needs a scroll view or a list with it. It's one line: a title too long for it ends with "…". On Android it's Material 3 Expressive's medium flexible app bar, which collapses into the small one the same way.

Beside the large title

An element marked largeTitleAccessory in the scroll view sits at the end of the large title's line, such as an account's picture or how something is doing:

<ui-navigation-bar title="Notes" largeTitle />
<scroll-view ui-bar-scroll scroll-orientation="vertical" class="h-full">
  <ui-avatar
    largeTitleAccessory
    [src]="account().picture"
    [alt]="account().name"
  />
  …
</scroll-view>
  • It's centered on the title's line, whatever its own height, and keeps its width: a long title ends with "…" before it.
  • It scrolls away with the large title. The bar shows only the title once that has gone under it, so keep what must stay in reach in the bar itself.
  • It's drawn only with a large title. Without one there is no line to put it on.

Title menu

With titleMenu, the title is a button with a chevron after it. Use it when the title picks what the screen shows, such as an account, a workspace or a calendar's month:

<ui-navigation-bar
  [title]="account().name"
  largeTitle
  titleMenu
  (titlePressed)="accountsOpen.set(true)"
/>
  • titlePressed emits on a tap on the title, in the bar or as the large title.
  • The menu is yours. The bar draws none: open a Menu, an Action Sheet or a Bottom Sheet.
  • A long title still ends with "…", and the chevron stays after it.
  • It's iOS's title menu, and the title with a dropdown arrow of a Material top app bar. In Android's small bar, the chevron follows the title at the start.

The scroll edge effect

On iOS 26 and later, content fades out as it passes under the glass bar, so the bar's controls stay legible over whatever is beneath them, as iOS's scroll edge effect does. It's a mask on the scroll view, so content fades to whatever is behind it: the screen's background, or an image. Android's scroll view takes no mask, so with the glass opt-in the bar fades content to the theme's background color instead.

The other designs mark the edge with the bar's own background instead: the frosted material before iOS 26, and Material's container color on Android.

Two bars at once

ui-bar-scroll and the bars find each other through UiBarState, a root service, which fits one screen at a time. Each screen of a <lynx-stack-outlet>, which keeps the screens under the top one alive, gets its own already. When two screens with bars show at once otherwise, such as a sheet with its own navigation bar over a screen, give the sheet's component its own:

@Component({ providers: [UiBarState], … })
export class EditNoteSheet {}

A bar of your own takes the state with injectBarState(), as these do, rather than inject(UiBarState): it's the component's own when one provides it, the stack screen's on one, and otherwise the root's.

Dark mode

The icons draw with the light theme's colors until you say otherwise, and the glass follows the same setting. If your app switches to dark mode, set the color scheme with provideIconTheme().

API

UiNavigationBar

InputTypeDefaultDescription
titlestring''The screen's title.
largeTitlebooleanfalseStarts the title large at the top of the content. Needs ui-bar-scroll.
titleCenteredbooleanfalseMaterial's center-aligned top app bar. iOS always centers the title.
titleMenubooleanfalseMakes the title a button with a chevron after it, in the bar and as the large title.
backLabelstring'Back'The previous screen's title, shown beside the Back button before iOS 26 and read by screen readers.
backRoutestring | undefinedundefinedWhere Back goes when there's no history, in place of the screen: a URL for Router.navigateByUrl().
backButtonHiddenbooleanfalseHides the Back button.
classstring''Extra Tailwind classes for the bar, which places itself at the top of its parent.
OutputTypeDescription
titlePressedvoidEmits on a tap on the title, in the bar or large, while titleMenu is set.
PropertyTypeDescription
canGoBackSignal<boolean>Whether there's a screen to go back to in the router's history.
designSignal<'glass' | 'frosted' | 'material'>The platform's design (see Glass).
goBack()methodGoes back as the Back button does. With nowhere to go, does nothing.

ui-bar-scroll and the items are on the Toolbar page.

Accessibility

  • The title is a heading. With a large title, the bar's copy is hidden from screen readers until the large one has scrolled under it.
  • With titleMenu, the title is one button named by its text. It's still a heading on iOS; Android reads one trait, so there it's a button.
  • The Back button is a button named by backLabel. Each item is a button named by its label, which icon-only items need too.
  • Reduce Motion: the title appears at once instead of fading in, and Material's bar changes color at once. A pressed title menu comes back at once instead of fading back.
  • Reduce Transparency and Increase Contrast are handled by the glass.
  • Toolbar: the items and groups, and a bar of actions along the bottom
  • Routing and navigation: going back through the router
  • Dock: a floating glass tab bar for the app's top-level screens
  • Glass: the glass the bar's controls are drawn with
  • Safe area: the inset the bar clears