Skip to content

Signal

Components

Section header

A section title with trailing meta. Web: .ct-section-header; React Native: SectionHeader.

A section title with optional trailing meta on its baseline. It starts each group in a list, a sheet or a page. iOS: SignalSectionHeader in the Signal package.

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-section-header">
  <h2>Arrivals</h2>
  <span class="ct-section-header-meta">Updated now</span>
</div>

Responsive behavior

ViewportLayout
Every widthThe same: spacing.sectionGap (24) above, 6 below; 4 above when it opens its container.

React Native

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

Tokens

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

Custom propertyValueAliasResolves to
--ct-section-header-gapvar(--space-8){space.s8}8 pt
--ct-section-header-margin-bottomvar(--space-6){space.s6}6 pt
--ct-section-header-margin-topvar(--space-section-gap){spacing.sectionGap}24 pt
--ct-section-header-margin-top-firstvar(--space-4){space.s4}4 pt
--ct-section-header-meta-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-section-header-meta-font-sizevar(--fs-sub){type.sub}13
--ct-section-header-title-colorvar(--ink){colors.ink}#101A2E #EEF1F6
--ct-section-header-title-font-sizevar(--fs-title){type.title}20
--ct-section-header-title-font-weightvar(--weight-bold){weight.bold}700

Variants

One form; no variants. .ct-section-header holds an <h2> (or .ct-section-header-title) and an optional .ct-section-header-meta; the first one in a container sits closer to the top. Nothing else exists.

<!-- Do -->
<div class="ct-section-header">
  <h2>Arrivals</h2>
  <span class="ct-section-header-meta">Updated now</span>
</div>
<!-- Don't: a control in the meta -->
<div class="ct-section-header">
  <h2>Arrivals</h2>
  <button class="ct-section-header-meta" type="button">Refresh</button>
</div>

Usage

Do

  • Use the heading level that fits the outline; the look stays the same.

Don't

  • Don't put controls in the meta; it is text.

Accessibility

  • The title is a real heading; the meta reads after it.

Contract

Contract: components/section-header.yaml. States are drawn live by transit.js.