Status Bar

The thin instrument strip along the edge of an app shell: an IDE, a terminal, a dispatch console. Small mono read-outs in a start, a center and an end region, divided by hairlines, with figures that tick in place.

  1. 21:41:52UNIT 12EN ROUTE5TH AVE & E 42ND ST
  2. 21:41:58UNIT 07ON SCENEBROADWAY & W 34TH ST
  3. 21:42:03DISPATCHCALL 4471NOISE, 210 W 31ST ST
  4. 21:42:05UNIT 12ACK 4471ETA 4 MIN
SecureUnit 12
ZoneMidtown
12ms21:42:07

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Add this component (its dependencies come along)npx koalaui-cli@latest add status-bar

Usage#

usage.tsxTSX
import {  StatusBar,  StatusBarItem,  StatusBarSection,  StatusBarSeparator,} from "@/components/ui/status-bar"export function Example() {  return (    <StatusBar>      <StatusBarSection>        <StatusBarItem>main</StatusBarItem>        <StatusBarSeparator />        <StatusBarItem>UTF-8</StatusBarItem>      </StatusBarSection>      <StatusBarSection align="end">        <StatusBarItem>Ln 42, Col 7</StatusBarItem>      </StatusBarSection>    </StatusBar>  )}

Anatomy#

import {  StatusBar,  StatusBarItem,  StatusBarSection,  StatusBarSeparator,  StatusBarSignal,} from "@/components/ui/status-bar"<StatusBar>  <StatusBarSection>    <StatusBarItem />    <StatusBarSeparator />    <StatusBarItem />  </StatusBarSection>  <StatusBarSection align="center" />  <StatusBarSection align="end">    <StatusBarSignal level={…} />  </StatusBarSection></StatusBar>

Regions#

StatusBarSection takes align: start (the default), center or end. The bar is a three-column grid and each section claims its column, so any of them can be left out: the center stays on the true center whatever sits beside it, and an end section stays at the end with no start. Each side gets half of what the center leaves, and a section on its own takes the whole bar.

mainUTF-8
Saved
Ln 42, Col 7
mainUTF-8
Ln 42, Col 7
Saved
Ln 42, Col 7

Tones#

StatusBarItem takes tone. default is the strip's meta ink, muted steps back for a label in front of its value, strong is the value that matters, and success is a healthy state. A leading dot is plain markup inside the item.

Branchmain3 changes
Build passing

Signal#

StatusBarSignal is a four-step meter: level lights that many bars (rounded and clamped to 0 to 4), and a change eases between steps. It is a meter named by label ("Signal" by default), so a screen reader hears "Link, 3 of 4".

No linkWeakFairGoodFull

On the app frame#

The strip paints nothing, so it takes the ground it sits on. On the near-black frame of a docked shell, pin it dark and it reads the same in every theme; inside a pane, give it a border-t and let it sit on the sheet.

Home6 apps
F1OpenEscClose

Announcing a value#

The bar is not a live region: a clock or a ping inside it would be read out on every tick. When one read-out deserves an announcement (a connection dropping, a build failing), put aria-live="polite" on that item alone.

<StatusBarItem aria-live="polite" tone={online ? "success" : "default"}>  {online ? "Connected" : "Reconnecting…"}</StatusBarItem>

API reference#

StatusBar

A 24px, three-column grid (1fr auto 1fr) in small uppercase mono with tabular-nums. Read-only, and not a live region. Every div prop is forwarded; className is merged last (h-7, px-3, border-t).

Data attributeDescription
data-slot"status-bar".

StatusBarSection

A row of read-outs, a div. Its align picks its column, so every section is droppable.

PropTypeDefaultDescription
align"start" | "center" | "end""start"The section's column. A section on its own spans the whole bar.
Data attributeDescription
data-slot"status-bar-section".
data-alignThe section's align.

StatusBarItem

A <span> that truncates: runs of text end in an ellipsis, glyphs beside them (a dot, a Kbd) hold their size.

PropTypeDefaultDescription
tone"default" | "muted" | "strong" | "success""default"The item's ink.
Data attributeDescription
data-slot"status-bar-item", with status-bar-item-text on each run of text.

StatusBarSeparator

A 12px hairline span, hidden from assistive tech.

Data attributeDescription
data-slot"status-bar-separator".

StatusBarSignal

A four-bar meter, valued 0 to 4. Every span prop but children is forwarded.

PropTypeDefaultDescription
level*number-How many of the four bars are lit, 0 to 4. Rounded and clamped.
labelstring"Signal"The meter's accessible name.
Data attributeDescription
data-slot"status-bar-signal", with status-bar-signal-bar on each bar.
data-levelThe clamped value, 0 to 4.
data-litOn each lit bar.

FAQ#

A Toolbar holds controls: buttons, toggles, menus, with roving focus. A Status Bar holds read-outs nobody presses. If an entry needs to be clicked, it belongs in the shell's bars or a Toolbar.