Skip to content

Signal

Components

Error state

Actionable API, network and decoding failure states: full-surface, inline stale-data banner and compact widget/Live Activity variants.

Live example

Rendered with the real classes from /site/chitransit.css, light (left) and dark (right).

Couldn’t load arrivals

Check your connection and try again.

.ct-error-state--surface

Couldn’t update arrivals

Updated 3 min ago

.ct-error-state--inline

Couldn’t update nearby stops

Updated 12 min ago

large text override
Can’t update.ct-error-state--compact

Code

<div style="width:100%;min-height:220px"><div class="ct-error-state ct-error-state--surface" role="group"><svg class="ct-error-state__icon" aria-hidden="true"><use href="#i-alert"/></svg><div class="ct-error-state__body"><p class="ct-error-state__message">Couldn’t load arrivals</p><p class="ct-error-state__meta">Check your connection and try again.</p></div><button class="ct-error-state__action" type="button">Retry</button></div></div>
<div class="ct-error-state ct-error-state--inline" role="group"><svg class="ct-error-state__icon" aria-hidden="true"><use href="#i-alert"/></svg><div class="ct-error-state__body"><p class="ct-error-state__message">Couldn’t update arrivals</p><p class="ct-error-state__meta">Updated 3 min ago</p></div><button class="ct-error-state__action" type="button">Retry</button></div>
<div class="ct-error-state ct-error-state--inline" role="group" style="--error-state-message-font-size:var(--fs-title);--error-state-meta-font-size:var(--fs-sub)"><svg class="ct-error-state__icon" aria-hidden="true"><use href="#i-alert"/></svg><div class="ct-error-state__body"><p class="ct-error-state__message">Couldn’t update nearby stops</p><p class="ct-error-state__meta">Updated 12 min ago</p></div><button class="ct-error-state__action" type="button">Retry</button></div>
<span class="ct-error-state ct-error-state--compact" role="status"><svg class="ct-error-state__icon" aria-hidden="true"><use href="#i-alert"/></svg><span class="ct-error-state__message">Can’t update</span></span>

Tokens

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

Custom propertyValueAliasResolves to
--ct-error-state-action-backgroundvar(--accent-tint){colors.accentTint}#EAF1FB #182944
--ct-error-state-action-background-hovervar(--accent-tint-hover){colors.accentTintHover}#D8E4F4 #1F3352
--ct-error-state-action-colorvar(--accent){colors.accent}#0B4EA2 #92B8F5
--ct-error-state-action-font-sizevar(--fs-sub){type.sub}13
--ct-error-state-action-font-weightvar(--weight-bold){weight.bold}700
--ct-error-state-action-heightvar(--size-minimum-tap-target){size.minimumTapTarget}44 pt
--ct-error-state-action-padding-xvar(--space-14){space.s14}14 pt
--ct-error-state-action-radiusvar(--r-card){radius.card}12 pt
--ct-error-state-background-compactvar(--card-2){colors.card2}#E9EBF1 #1F2733
--ct-error-state-background-inlinevar(--card){colors.card}#EDEEF1 #1D232D
--ct-error-state-background-surfacevar(--card){colors.card}#EDEEF1 #1D232D
--ct-error-state-compact-gapvar(--space-6){space.s6}6 pt
--ct-error-state-compact-padding-xvar(--space-10){space.s10}10 pt
--ct-error-state-compact-padding-yvar(--space-6){space.s6}6 pt
--ct-error-state-compact-radiusvar(--radius-pill){radius.pill}999 pt
--ct-error-state-framevar(--shadow-frame){shadows.frame}
--ct-error-state-icon-colorvar(--alert){colors.alert}#C85414 #F08A4A
--ct-error-state-icon-size-compactvar(--size-metadata-glyph){size.metadataGlyph}16 pt
--ct-error-state-icon-size-inlinevar(--size-control-glyph){size.controlGlyph}22 pt
--ct-error-state-icon-size-surfacevar(--size-alert-glyph){size.alertGlyph}28 pt
--ct-error-state-inline-gapvar(--space-10){space.s10}10 pt
--ct-error-state-inline-padding-xvar(--space-14){space.s14}14 pt
--ct-error-state-inline-padding-yvar(--space-12){space.s12}12 pt
--ct-error-state-inline-radiusvar(--r-card){radius.card}12 pt
--ct-error-state-message-colorvar(--ink){colors.ink}#101A2E #EEF1F6
--ct-error-state-message-font-sizevar(--fs-body){type.body}16
--ct-error-state-message-font-weightvar(--weight-semibold){weight.semibold}600
--ct-error-state-meta-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-error-state-meta-font-sizevar(--fs-cap){type.cap}12
--ct-error-state-meta-font-weightvar(--weight-medium){weight.medium}500
--ct-error-state-surface-gapvar(--space-12){space.s12}12 pt
--ct-error-state-surface-max-widthvar(--size-error-state-maximum-width){size.errorStateMaximumWidth}360 pt
--ct-error-state-surface-padding-xvar(--space-20){space.s20}20 pt
--ct-error-state-surface-padding-yvar(--space-32){space.s32}32 pt
--ct-error-state-surface-radiusvar(--r-card){radius.card}12 pt

React Native

Use the shared component from @chitransit/signal/rn. API and live gallery.

Contract

Contract: components/error-state.yaml. States are drawn live by transit.js.

Variants

--surface fills a pane (message, meta and Retry), --inline sits in a card or list row (message and meta), --compact is one short line. Nothing else exists; there is no default, so always name one.

  • The whole pane failed to load: --surface with Retry.
  • One section of a page failed: --inline.
  • A small value is missing (a time, a count): --compact.
<!-- Do -->
<span class="ct-error-state ct-error-state--compact" role="status">…</span>
<!-- Don't: a toast or red text in place of the error state -->
<p style="color:red">Error</p>

Usage

Do

  • Use full-surface when no trustworthy content can be shown.
  • Use inline stale when old arrivals remain visible; include Updated X ago.
  • Use compact copy Can’t update in widgets and Live Activities.

Don't

  • Don’t show network failures as No arrivals, No stops, Last stop, or current-looking stale data.
  • Don’t expose exception names, endpoints or upstream error bodies to riders.

Accessibility

  • Hide the alert glyph from assistive technology; the message carries the meaning.
  • Full and inline variants use a real Retry button with a 44pt minimum target.
  • VoiceOver should encounter the message, freshness when present, and the Retry action in that order.