Skip to content

Signal

Components

App bar

The app view bar under the site header: tabs and a status line.

The app's view bar under the site header: a Tab strip, an optional spacer and a status line. On compact screens it holds only the tab strip, edge to edge at the touch size.

Live example

The real classes from /site/chitransit.css in frames at phone, tablet and desktop widths, in the docs theme. The contract below shows each width in light and dark.

Phone · 390 × 760
Tablet · 768 × 900
Desktop · 1280 × 800

Code

<div class="ct-app-bar">
  <div class="ct-tab-strip">
    <nav class="ct-segmented ct-segmented--fill ct-tabs" aria-label="App views">…</nav>
  </div>
  <span class="ct-app-bar-status" role="status">Live · updated 12 s ago</span>
</div>

Responsive behavior

ViewportLayout
> 900 wide52 tall (size.appBar), padded by --gutter: tabs, then the status line at the end.
≤ 900 wide or ≤ 500 tall56 tall (size.appBarCompact), no side padding; only the tab strip.
≤ 500 tall and ≥ 600 wideBack to 52 tall.

Tokens

From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.

Custom propertyValueAliasResolves to
--ct-app-bar-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-app-bar-bordervar(--line){colors.line}#DADDE3 #263041
--ct-app-bar-gapvar(--space-16){space.s16}16 pt
--ct-app-bar-height-compactvar(--size-app-bar-compact){size.appBarCompact}56 pt
--ct-app-bar-heightvar(--size-app-bar){size.appBar}52 pt
--ct-app-bar-padding-y-compactvar(--space-4){space.s4}4 pt
--ct-app-bar-padding-y-shortvar(--space-2){space.s2}2 pt
--ct-app-bar-status-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-app-bar-status-font-sizevar(--fs-sub){type.sub}13

Variants

One form; no variants. .ct-app-bar holds a .ct-tab-strip, then an optional .ct-app-bar-spacer and .ct-app-bar-status. The compact layout comes from the viewport, not a class. Nothing else exists.

<!-- Do -->
<div class="ct-app-bar">
  <div class="ct-tab-strip">…</div>
  <span class="ct-app-bar-status" role="status">Live · updated 12 s ago</span>
</div>
<!-- Don't: actions in the bar; no such variant -->
<div class="ct-app-bar ct-app-bar--compact">
  <button class="ct-button" type="button">Refresh</button>
</div>

Usage

Do

  • Keep the status line short and supplementary.

Don't

  • Don't put actions in the app bar; they belong in the view.

Accessibility

  • Give a status line that updates on its own role="status".

Contract

Contract: components/app-bar.yaml. States are drawn live by transit.js.