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.
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
| Viewport | Layout |
|---|---|
| > 900 wide | 52 tall (size.appBar), padded by --gutter: tabs, then the status line at the end. |
| ≤ 900 wide or ≤ 500 tall | 56 tall (size.appBarCompact), no side padding; only the tab strip. |
| ≤ 500 tall and ≥ 600 wide | Back to 52 tall. |
Tokens
From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.
| Custom property | Value | Alias | Resolves to |
|---|---|---|---|
--ct-app-bar-background | var(--paper) | {colors.paper} | #FFFFFF #0F141C |
--ct-app-bar-border | var(--line) | {colors.line} | #DADDE3 #263041 |
--ct-app-bar-gap | var(--space-16) | {space.s16} | 16 pt |
--ct-app-bar-height-compact | var(--size-app-bar-compact) | {size.appBarCompact} | 56 pt |
--ct-app-bar-height | var(--size-app-bar) | {size.appBar} | 52 pt |
--ct-app-bar-padding-y-compact | var(--space-4) | {space.s4} | 4 pt |
--ct-app-bar-padding-y-short | var(--space-2) | {space.s2} | 2 pt |
--ct-app-bar-status-color | var(--muted) | {colors.muted} | #5B6472 #B0BACA |
--ct-app-bar-status-font-size | var(--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.
Loading the contract…