<!-- generated by scripts/gen-docs.mjs from docs/system/banner.md. Edit the source and rerun. -->
# Banner

## Description
Says one thing about the whole app that came while the person was reading, such as being offline or a new version being ready, in a line that floats at the foot of the window and moves nothing on the page.

`import { Banner, OfflineBanner } from "@/components/cobalt/ui/banner"`, source `registry/cobalt/ui/banner.tsx`, status `ready`.
`import { useOnline, checkOnline, reportOffline } from "@/lib/cobalt/use-online"`, source `registry/cobalt/lib/use-online.ts`.
Foundation: `hand-rolled`. Traps checked: `trap/toast-errors`, `trap/toast-timer`, `trap/live-region-double`, `trap/color-only-status`, `trap/loading-layout-shift`, `trap/reduced-motion-ignored`, `trap/safe-area` (n/a: it sits 96px above a phone's bottom edge, clear of the home indicator), `trap/demo-on-timers` (n/a: the waits stand in for a server).

`trap/toast-errors` is answered by a banner for a condition that lasts, never a toast that times out while still offline (Rules). `trap/toast-timer` by no timer: a condition goes when it ends, news when it is dismissed (States). `trap/live-region-double` by one status region that is always there, with the visible words hidden from it (ARIA). `trap/color-only-status` by words and a glyph (States). `trap/loading-layout-shift` by floating, so it takes no room on the page (Rules). `trap/reduced-motion-ignored` by fades only under reduced motion (Motion).

### Foundation
Not applicable: hand-rolled.

| Given by the foundation | Added by the team |
|---|---|
| Not applicable: hand-rolled, on the popup surface (`bg-popover`, `shadow-floating`, `--r-3xl` around `--pad-popup`, so a small button inside is concentric) | A fixed line at the foot of the window, 20px up, and 96px up below 640px, clear of a phone's tab bar; one stacking rule with the toasts at every width, the banner holding the bottom line and the toasts standing above it: while it shows, the room it takes from the window's bottom edge plus 8px is written on the root as `--banner-clearance`, which the Toaster rises to, and it is cleared once the banner has faded, so the toasts come down after it and never across it; Arrive on `--t-arrive` and Leave on `--t-leave`; the action moves under the words when both do not fit; a close button only with `onDismiss`; an always-mounted `role="status"` that takes the words on open; `OfflineBanner`, wired to `useOnline`, whose Try again asks the server first, shakes and says Still offline while it cannot be reached, and reads again only once it answers; `useOnline`, one store for the page: the browser's word corrected by the last health check, with `checkOnline`, `reportOffline` and `readOnline` |

## Examples
A list of filings that stays on screen while offline, with the line at the foot of the window; Refresh fails in place and Try again asks the server before reading again.

Real uses, 0 call sites (`rg -n "<Banner\b|<OfflineBanner\b" app registry --glob '!registry/cobalt/ui/*'`): the part is new. The TSA app draws the same offline pill by hand in its load-problem module (`docs/research/2026-10-17-missing-parts.md`, F5).

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/banner/default.tsx` | default | Offline, the list stays and a line floats at the foot of the window; Try again asks the server before reading again |
| `docs/system/examples/banner/default.tsx` | state:condition | Offline, with one action and no close button |
| `docs/system/examples/banner/default.tsx` | state:checking | Try again asks the server, with a spinner after 250ms |
| `docs/system/examples/banner/default.tsx` | state:still-offline | The check got no answer: the line shakes and says Still offline |
| `docs/system/examples/banner/news.tsx` | state:news | News with one action and a close button |
| Not applicable: closed is every example before it opens, an empty status region and nothing drawn | state:closed | Nothing on screen |
| `docs/system/examples/banner/default.tsx` | composition:Item | The list of filings that stays while the line speaks |

Example: Offline, the list stays and a line floats at the foot of the window; Try again asks the server before reading again (`docs/system/examples/banner/default.tsx`)

```tsx
import { useEffect, useState } from "react";

import { OfflineBanner } from "@/components/cobalt/ui/banner";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { ListBody } from "@/components/cobalt/ui/list-body";
import { StateButton } from "@/components/cobalt/ui/state-button";
import { Failure, failureOf } from "@/lib/cobalt/failure";
import { useAction } from "@/lib/cobalt/use-action";
import { reportOffline } from "@/lib/cobalt/use-online";
import { useSlowWait } from "@/lib/cobalt/use-slow-wait";

// When each filing came in, as the list shows it.
const filedAgo = ["2 hours ago", "Yesterday", "3 days ago"];

const offline = () => !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";

// Stands in for your health check and your API call: each answers after 700ms, and neither can
// reach the server while the browser is offline or the address has ?network=offline.
const health = () => new Promise<boolean>((resolve) => setTimeout(() => resolve(!offline()), 700));
const readFilings = () =>
  new Promise<string[]>((resolve, reject) =>
    setTimeout(() => {
      if (offline()) reject(new Failure("offline"));
      else resolve(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
    }, 700),
  );

export default function Example() {
  const [filings, setFilings] = useState(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
  const refresh = useAction(async () => {
    try {
      setFilings(await readFilings());
    } catch (error) {
      // The rows on screen stay; the line at the foot says why they did not change.
      if (failureOf(error) === "offline") reportOffline();
      throw error;
    }
  });
  // The docs' Offline control changes the address; a real app hears the browser's offline event.
  useEffect(() => {
    const changed = () => {
      if (offline()) reportOffline();
    };
    window.addEventListener("cobalt-network", changed);
    return () => window.removeEventListener("cobalt-network", changed);
  }, []);
  const dim = useSlowWait(refresh.status === "pending");
  return (
    <div className="flex w-full max-w-md flex-col gap-3">
      <div className="flex items-center justify-between gap-4">
        <h3 className="text-base font-semibold">Latest filings</h3>
        <StateButton
          size="sm"
          variant="secondary"
          status={refresh.status}
          pendingLabel="Refreshing"
          failureLabel="Not refreshed"
          onClick={() => void refresh.run()}
        >
          Refresh
        </StateButton>
      </div>
      <ListBody busy={dim}>
        <ItemGroup variant="card" render={<ul aria-label="Latest filings" />}>
          {filings.map((name, i) => (
            <Item key={name} render={<li />}>
              <ItemContent>
                <ItemTitle>{name}</ItemTitle>
                <ItemDescription>Form N-PORT</ItemDescription>
              </ItemContent>
              <ItemActions>{filedAgo[i]}</ItemActions>
            </Item>
          ))}
        </ItemGroup>
      </ListBody>
      <OfflineBanner probe={health} onReconnect={() => refresh.run()} />
    </div>
  );
}
```

Example: The list of filings that stays while the line speaks (`docs/system/examples/banner/default.tsx`)

```tsx
import { useEffect, useState } from "react";

import { OfflineBanner } from "@/components/cobalt/ui/banner";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { ListBody } from "@/components/cobalt/ui/list-body";
import { StateButton } from "@/components/cobalt/ui/state-button";
import { Failure, failureOf } from "@/lib/cobalt/failure";
import { useAction } from "@/lib/cobalt/use-action";
import { reportOffline } from "@/lib/cobalt/use-online";
import { useSlowWait } from "@/lib/cobalt/use-slow-wait";

// When each filing came in, as the list shows it.
const filedAgo = ["2 hours ago", "Yesterday", "3 days ago"];

const offline = () => !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";

// Stands in for your health check and your API call: each answers after 700ms, and neither can
// reach the server while the browser is offline or the address has ?network=offline.
const health = () => new Promise<boolean>((resolve) => setTimeout(() => resolve(!offline()), 700));
const readFilings = () =>
  new Promise<string[]>((resolve, reject) =>
    setTimeout(() => {
      if (offline()) reject(new Failure("offline"));
      else resolve(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
    }, 700),
  );

export default function Example() {
  const [filings, setFilings] = useState(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
  const refresh = useAction(async () => {
    try {
      setFilings(await readFilings());
    } catch (error) {
      // The rows on screen stay; the line at the foot says why they did not change.
      if (failureOf(error) === "offline") reportOffline();
      throw error;
    }
  });
  // The docs' Offline control changes the address; a real app hears the browser's offline event.
  useEffect(() => {
    const changed = () => {
      if (offline()) reportOffline();
    };
    window.addEventListener("cobalt-network", changed);
    return () => window.removeEventListener("cobalt-network", changed);
  }, []);
  const dim = useSlowWait(refresh.status === "pending");
  return (
    <div className="flex w-full max-w-md flex-col gap-3">
      <div className="flex items-center justify-between gap-4">
        <h3 className="text-base font-semibold">Latest filings</h3>
        <StateButton
          size="sm"
          variant="secondary"
          status={refresh.status}
          pendingLabel="Refreshing"
          failureLabel="Not refreshed"
          onClick={() => void refresh.run()}
        >
          Refresh
        </StateButton>
      </div>
      <ListBody busy={dim}>
        <ItemGroup variant="card" render={<ul aria-label="Latest filings" />}>
          {filings.map((name, i) => (
            <Item key={name} render={<li />}>
              <ItemContent>
                <ItemTitle>{name}</ItemTitle>
                <ItemDescription>Form N-PORT</ItemDescription>
              </ItemContent>
              <ItemActions>{filedAgo[i]}</ItemActions>
            </Item>
          ))}
        </ItemGroup>
      </ListBody>
      <OfflineBanner probe={health} onReconnect={() => refresh.run()} />
    </div>
  );
}
```

## Variants
Not applicable: one line. A condition and news differ by `onDismiss`, which adds the close button.

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| closed | `open` false | nothing | nothing drawn; the status region is empty | test |
| condition | `open`, no `onDismiss` | press the action; wait for it to end | the words and the glyph; the action | test |
| news | `open` with `onDismiss` | press the action, or close it | the words; the action and the close button | test |
| checking | OfflineBanner's Try again pressed | wait | the StateButton's spinner and "Checking" after 250ms | screenshot |
| still-offline | the check got no answer | press again | a Shake, and the StateButton's cross and "Still offline" for 1.5 seconds | screenshot |

Example: Offline, with one action and no close button (`docs/system/examples/banner/default.tsx`)

```tsx
import { useEffect, useState } from "react";

import { OfflineBanner } from "@/components/cobalt/ui/banner";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { ListBody } from "@/components/cobalt/ui/list-body";
import { StateButton } from "@/components/cobalt/ui/state-button";
import { Failure, failureOf } from "@/lib/cobalt/failure";
import { useAction } from "@/lib/cobalt/use-action";
import { reportOffline } from "@/lib/cobalt/use-online";
import { useSlowWait } from "@/lib/cobalt/use-slow-wait";

// When each filing came in, as the list shows it.
const filedAgo = ["2 hours ago", "Yesterday", "3 days ago"];

const offline = () => !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";

// Stands in for your health check and your API call: each answers after 700ms, and neither can
// reach the server while the browser is offline or the address has ?network=offline.
const health = () => new Promise<boolean>((resolve) => setTimeout(() => resolve(!offline()), 700));
const readFilings = () =>
  new Promise<string[]>((resolve, reject) =>
    setTimeout(() => {
      if (offline()) reject(new Failure("offline"));
      else resolve(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
    }, 700),
  );

export default function Example() {
  const [filings, setFilings] = useState(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
  const refresh = useAction(async () => {
    try {
      setFilings(await readFilings());
    } catch (error) {
      // The rows on screen stay; the line at the foot says why they did not change.
      if (failureOf(error) === "offline") reportOffline();
      throw error;
    }
  });
  // The docs' Offline control changes the address; a real app hears the browser's offline event.
  useEffect(() => {
    const changed = () => {
      if (offline()) reportOffline();
    };
    window.addEventListener("cobalt-network", changed);
    return () => window.removeEventListener("cobalt-network", changed);
  }, []);
  const dim = useSlowWait(refresh.status === "pending");
  return (
    <div className="flex w-full max-w-md flex-col gap-3">
      <div className="flex items-center justify-between gap-4">
        <h3 className="text-base font-semibold">Latest filings</h3>
        <StateButton
          size="sm"
          variant="secondary"
          status={refresh.status}
          pendingLabel="Refreshing"
          failureLabel="Not refreshed"
          onClick={() => void refresh.run()}
        >
          Refresh
        </StateButton>
      </div>
      <ListBody busy={dim}>
        <ItemGroup variant="card" render={<ul aria-label="Latest filings" />}>
          {filings.map((name, i) => (
            <Item key={name} render={<li />}>
              <ItemContent>
                <ItemTitle>{name}</ItemTitle>
                <ItemDescription>Form N-PORT</ItemDescription>
              </ItemContent>
              <ItemActions>{filedAgo[i]}</ItemActions>
            </Item>
          ))}
        </ItemGroup>
      </ListBody>
      <OfflineBanner probe={health} onReconnect={() => refresh.run()} />
    </div>
  );
}
```

Example: Try again asks the server, with a spinner after 250ms (`docs/system/examples/banner/default.tsx`)

```tsx
import { useEffect, useState } from "react";

import { OfflineBanner } from "@/components/cobalt/ui/banner";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { ListBody } from "@/components/cobalt/ui/list-body";
import { StateButton } from "@/components/cobalt/ui/state-button";
import { Failure, failureOf } from "@/lib/cobalt/failure";
import { useAction } from "@/lib/cobalt/use-action";
import { reportOffline } from "@/lib/cobalt/use-online";
import { useSlowWait } from "@/lib/cobalt/use-slow-wait";

// When each filing came in, as the list shows it.
const filedAgo = ["2 hours ago", "Yesterday", "3 days ago"];

const offline = () => !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";

// Stands in for your health check and your API call: each answers after 700ms, and neither can
// reach the server while the browser is offline or the address has ?network=offline.
const health = () => new Promise<boolean>((resolve) => setTimeout(() => resolve(!offline()), 700));
const readFilings = () =>
  new Promise<string[]>((resolve, reject) =>
    setTimeout(() => {
      if (offline()) reject(new Failure("offline"));
      else resolve(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
    }, 700),
  );

export default function Example() {
  const [filings, setFilings] = useState(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
  const refresh = useAction(async () => {
    try {
      setFilings(await readFilings());
    } catch (error) {
      // The rows on screen stay; the line at the foot says why they did not change.
      if (failureOf(error) === "offline") reportOffline();
      throw error;
    }
  });
  // The docs' Offline control changes the address; a real app hears the browser's offline event.
  useEffect(() => {
    const changed = () => {
      if (offline()) reportOffline();
    };
    window.addEventListener("cobalt-network", changed);
    return () => window.removeEventListener("cobalt-network", changed);
  }, []);
  const dim = useSlowWait(refresh.status === "pending");
  return (
    <div className="flex w-full max-w-md flex-col gap-3">
      <div className="flex items-center justify-between gap-4">
        <h3 className="text-base font-semibold">Latest filings</h3>
        <StateButton
          size="sm"
          variant="secondary"
          status={refresh.status}
          pendingLabel="Refreshing"
          failureLabel="Not refreshed"
          onClick={() => void refresh.run()}
        >
          Refresh
        </StateButton>
      </div>
      <ListBody busy={dim}>
        <ItemGroup variant="card" render={<ul aria-label="Latest filings" />}>
          {filings.map((name, i) => (
            <Item key={name} render={<li />}>
              <ItemContent>
                <ItemTitle>{name}</ItemTitle>
                <ItemDescription>Form N-PORT</ItemDescription>
              </ItemContent>
              <ItemActions>{filedAgo[i]}</ItemActions>
            </Item>
          ))}
        </ItemGroup>
      </ListBody>
      <OfflineBanner probe={health} onReconnect={() => refresh.run()} />
    </div>
  );
}
```

Example: The check got no answer: the line shakes and says Still offline (`docs/system/examples/banner/default.tsx`)

```tsx
import { useEffect, useState } from "react";

import { OfflineBanner } from "@/components/cobalt/ui/banner";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { ListBody } from "@/components/cobalt/ui/list-body";
import { StateButton } from "@/components/cobalt/ui/state-button";
import { Failure, failureOf } from "@/lib/cobalt/failure";
import { useAction } from "@/lib/cobalt/use-action";
import { reportOffline } from "@/lib/cobalt/use-online";
import { useSlowWait } from "@/lib/cobalt/use-slow-wait";

// When each filing came in, as the list shows it.
const filedAgo = ["2 hours ago", "Yesterday", "3 days ago"];

const offline = () => !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";

// Stands in for your health check and your API call: each answers after 700ms, and neither can
// reach the server while the browser is offline or the address has ?network=offline.
const health = () => new Promise<boolean>((resolve) => setTimeout(() => resolve(!offline()), 700));
const readFilings = () =>
  new Promise<string[]>((resolve, reject) =>
    setTimeout(() => {
      if (offline()) reject(new Failure("offline"));
      else resolve(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
    }, 700),
  );

export default function Example() {
  const [filings, setFilings] = useState(["Harbour Large Cap Core", "Calder Global Equity", "Northgate Short Duration"]);
  const refresh = useAction(async () => {
    try {
      setFilings(await readFilings());
    } catch (error) {
      // The rows on screen stay; the line at the foot says why they did not change.
      if (failureOf(error) === "offline") reportOffline();
      throw error;
    }
  });
  // The docs' Offline control changes the address; a real app hears the browser's offline event.
  useEffect(() => {
    const changed = () => {
      if (offline()) reportOffline();
    };
    window.addEventListener("cobalt-network", changed);
    return () => window.removeEventListener("cobalt-network", changed);
  }, []);
  const dim = useSlowWait(refresh.status === "pending");
  return (
    <div className="flex w-full max-w-md flex-col gap-3">
      <div className="flex items-center justify-between gap-4">
        <h3 className="text-base font-semibold">Latest filings</h3>
        <StateButton
          size="sm"
          variant="secondary"
          status={refresh.status}
          pendingLabel="Refreshing"
          failureLabel="Not refreshed"
          onClick={() => void refresh.run()}
        >
          Refresh
        </StateButton>
      </div>
      <ListBody busy={dim}>
        <ItemGroup variant="card" render={<ul aria-label="Latest filings" />}>
          {filings.map((name, i) => (
            <Item key={name} render={<li />}>
              <ItemContent>
                <ItemTitle>{name}</ItemTitle>
                <ItemDescription>Form N-PORT</ItemDescription>
              </ItemContent>
              <ItemActions>{filedAgo[i]}</ItemActions>
            </Item>
          ))}
        </ItemGroup>
      </ListBody>
      <OfflineBanner probe={health} onReconnect={() => refresh.run()} />
    </div>
  );
}
```

Example: News with one action and a close button (`docs/system/examples/banner/news.tsx`)

```tsx
import { useState } from "react";

import { Banner } from "@/components/cobalt/ui/banner";
import { Button } from "@/components/cobalt/ui/button";

export default function Example() {
  const [open, setOpen] = useState(false);
  return (
    <>
      {/* Docs control, not part of the product: stands in for a release landing while you read. */}
      <div className="flex flex-wrap items-center gap-2 border-t border-dashed pt-3">
        <Button variant="ghost" size="sm" disabled={open} onClick={() => setOpen(true)}>
          Release a new version
        </Button>
      </div>
      <Banner
        open={open}
        onDismiss={() => setOpen(false)}
        action={
          <Button size="sm" variant="ghost" onClick={() => setOpen(false)}>
            Reload
          </Button>
        }
      >
        A new version is ready.
      </Banner>
    </>
  );
}
```

### State precedence
- Condition and news: Not applicable: `onDismiss` makes it one or the other.
- Checking and still-offline: still-offline wins once the check answers.
- Closed and any other: closed wins. OfflineBanner closes the moment the server answers, even mid-check.
- Banner and toasts: both show. The banner holds the bottom line and the toasts stand 8px above it, at every width. Measured on the stress page with a toast showing (`.design-system/evidence/banner/stack-with-toasts.json`): before, at 768 the toast (392 to 748px across, 732 to 780px down) covered the banner (191 to 577px, 736 to 780px), at 1024 they overlapped by 57px, and at 390 a two-line banner (640 to 704px down) ran 12px under the toast's 148px offset; after, the toast stands 8px above the banner at 390, 768, 1024 and 1440, light and dark, and overlaps it nowhere.

### Motion
| Trigger | Kind | Preset | Properties | Reduced motion |
|---|---|---|---|---|
| open | announce | Arrive: `times.arrive` on `curves.out`, 4px up | opacity, transform | opacity only, through `MotionConfig reducedMotion="user"` |
| close | announce | Leave: `times.leave` on `curves.out` | opacity | the same fade |
| a banner opens or leaves while toasts show | announce | the Toaster's stack rises by what the banner takes above its own offset, and settles back once the banner has left, on `--t-settle` and `--curve-settle` | translate of the stack | the stack moves at once |
| a check finds the server still out of reach | input | Shake: `shake` from `registry/cobalt/lib/motion.ts` | transform, 6px each way | no shake; the StateButton's cross and word still say it |

## Props

<!-- Props generated from registry/cobalt/ui/banner.tsx with TypeScript by scripts/props-table.mjs -->
### Banner

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `children` | `ReactNode` |  | The line: what is true now, and what it means. |
| `open` | `boolean` |  |  |
| `action?` | `ReactNode` |  | One small button: `Button size="sm" variant="ghost"`, or a `StateButton` when it waits. |
| `bannerRef?` | `Ref<HTMLDivElement>` |  | The floating line itself, for a shake when an action finds nothing changed. |
| `className?` | `string` |  |  |
| `dismissLabel?` | `string` | `"Dismiss"` |  |
| `icon?` | `ReactNode` |  | A glyph before the words, such as a cloud with a line through it for offline. |
| `onDismiss?` | `() => void` |  | Shows the close button. |

### OfflineBanner

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `checkingLabel?` | `string` | `"Checking"` | Said on the button while the server is asked. |
| `children?` | `ReactNode` | `"You are offline. This may be out of date."` |  |
| `onReconnect?` | `() => void \| Promise<unknown>` |  | Reads what is on screen again once the server answers. |
| `probe?` | `Probe` |  | The health check: an address to fetch, or a function that resolves true when the server answers. |
| `retryLabel?` | `string` | `"Try again"` |  |
| `stillOfflineLabel?` | `string` | `"Still offline"` | Said on the button when the server still does not answer. |

`open` shows the line. `children` are its words. `icon` is a glyph before them. `action` is one small button, a ghost `Button` or a `StateButton`. `onDismiss` adds the close button, named by `dismissLabel`, "Dismiss" by default. `bannerRef` reaches the floating line. `className` styles the line.

`OfflineBanner` takes `probe`, the health check (an address, or a function that resolves true when the server answers), `onReconnect`, which reads the page again once it does, `retryLabel`, `checkingLabel` and `stillOfflineLabel` for the button's words, and its line as `children`.

## Usage

### When to use
- The app lost its connection while the person reads, and what is on screen stays useful.
- News about the app that can wait: a new version is ready, maintenance starts in 10 minutes.

### When not to use
- Something known when the page renders, such as a read-only workspace or a plan limit. Use Alert instead, in the page.
- The page has nothing to show because it could not load. Use PageProblem instead.
- Something finished that the person started. Use Toaster instead.

### Rules
- `rule/banner-check-before-reading`: When the person presses Try again while offline, ask the server first through `useOnline`'s `check` or `OfflineBanner`, and read the page again only once it answers, instead of reading again at once, because a read that fails offline swaps what is on screen for an error. Evidence: app 1/2 source apps, the TSA app's offline pill checks its health route before revalidating, docs/research/2026-10-17-missing-parts.md F5; person D37. Check: test `use-online.test.ts` "while the browser says offline, no check is sent and the answer is no".
  - Don't: `<Banner open={!online} action={<Button onClick={() => revalidate()}>Try again</Button>}>You are offline.</Banner>`
  - Do: `<OfflineBanner probe="/healthz" onReconnect={() => revalidate()} />`
- `rule/banner-floats`: When a condition arrives while the person reads, show it in `Banner`, which floats at the foot of the window, instead of a line inserted above the content, because a line inserted at the top pushes everything under it down by its height. Evidence: person D37; measured the line at 64px tall and 96px above the foot at 390, out of the page's flow, docs/system/stress/banner.tsx. Check: test `banner.test.tsx` "it floats, so it never moves the page".
  - Don't: `{!online && <div className="bg-warning-soft p-3">You are offline.</div>}` at the top of the page
  - Do: `<OfflineBanner probe="/healthz" />`
- `rule/banner-condition-not-dismissible`: When the line says a condition that lasts, such as offline, leave out `onDismiss`, and pass it only for news, because a condition dismissed while it still holds leaves the person reading stale data with no sign of it. Evidence: principle heuristic: visibility of system status. Check: review.
  - Don't: `<Banner open={!online} onDismiss={hide}>You are offline.</Banner>`
  - Do: `<Banner open={!online}>You are offline. This may be out of date.</Banner>`

### Content
- Follows `rule/writing-no-invented-numbers`.
- `rule/banner-words-what-is-true`: When writing the words, say what is true now and what it means in at most 2 short sentences, such as "You are offline. This may be out of date.", instead of a title and a paragraph, because the line is one line on a phone and is read while the person does something else. Evidence: principle heuristic: visibility of system status; measured the German worst case of 130 characters on 4 lines at 320, docs/system/stress/banner.tsx. Check: review.
  - Don't: `<Banner open>Connection problem! We were unable to reach our servers. Please check your internet connection and try again later.</Banner>`
  - Do: `<Banner open>You are offline. This may be out of date.</Banner>`

### Anti-slop
- `rule/banner-one-at-a-time`: When more than one condition holds, show the one that matters most in one `Banner`, instead of stacking banners, because 2 lines at the foot cover the content a phone shows above its tab bar. Evidence: principle heuristic: aesthetic and minimalist design. Check: review.
  - Don't: `<><Banner open>You are offline.</Banner><Banner open>A new version is ready.</Banner></>`
  - Do: `<Banner open={!online}>You are offline. This may be out of date.</Banner>`

### Limits
- `rule/banner-length`: When the words run past 80 characters, cut them to the condition and its meaning, because at 320px a 130-character line takes 4 lines and a 140px tall banner over the foot of the page. Evidence: measured 140px tall at 320 and 120px at 390 for the 130-character German case, against 64px for the 41-character English one, docs/system/stress/banner.tsx. Check: probe docs/system/stress/banner.tsx on the break-ui harness at 320.
  - Don't: `<Banner open>Sie sind offline. Was Sie hier sehen, ist möglicherweise nicht mehr aktuell, bis die Verbindung zum Server wiederhergestellt ist.</Banner>`
  - Do: `<Banner open>Sie sind offline. Dies ist eventuell veraltet.</Banner>`

## Accessibility
Rests on a `role="status"` region that is mounted empty and takes the words when the line opens, and the system's buttons for the action and the close.

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | the page | reaches the action, then the close button, in the order they sit at the end of the page | the action | by hand |
| Enter | the action | runs it; Try again asks the server | stays on the button | by hand |
| Enter | the close button | closes the line | the host's choice; the line leaves the tab order | by hand |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| status region | status | none | always mounted, empty while closed | the words, once, when the line opens | test |
| words | none, `aria-hidden` | none | none | nothing; the status region says them | test |
| action | button | its words | StateButton's `aria-busy` while it checks | the StateButton's status line | test |
| close | button | `dismissLabel` | none | "Dismiss, button" | test |

## Tokens
| Part | State | Token |
|---|---|---|
| line | all | `--popover`, `--popover-foreground`, `--shadow-floating`, `--r-3xl`, `--pad-popup` |
| glyph | all | `--muted-foreground` |
| line | open, close | `--t-arrive`, `--t-leave`, `--curve` |

## Related
- Alert: a note about the page, known when it renders.
- PageProblem: a page with nothing to show.
- Toaster: something the person started that finished elsewhere.
- StateButton: the Try again that reports its own check.
