AuroraDesign System
1.0
Components

Segmented control

Switches between two to four views of the same thing. The bone indicator glides between options; it never jumps, and the text inverts as it arrives.

Status
Stable
Options
2 to 4

Overview

Showing the day
Click or use the arrow keys

Anatomy

  1. 1
    Track
    A hairline box with square corners. Square, because it’s a switch, not a button.
    --au-border-hairline
  2. 2
    Indicator
    A bone block that slides to the selected option over 600ms on the glide curve.
    --au-bg-inverse
  3. 3
    Option
    Label type. Inverts to ink on bone when selected. Trailing tracking trimmed so it centres true.
    .au-type-label

Usage

Do

Use it to switch views of the same content, with short, parallel labels.

Don’t

Don’t use it for actions or for more than four options. Actions are buttons; long lists are navigation.

Accessibility

  • A radio group. The track is role="radiogroup" with a required label; each option is a radio.
  • One tab stop. Tab lands on the selected option; arrow keys move selection and focus together, and wrap.

Props

PropTypeDefaultDescription
options*{ value: string; label: string }[]—Two to four options.
value*string—The selected option.
onChange*(value: string) => void—Called with the new value.
label*string—Names the group for assistive technology.

Tokens

TokenValueUsed for
--au-bg-inverse→ stone.50 · #EDEBE5Fills that have been committed, like a held button.
--au-text-inverse→ night.950 · #08090A
--au-text-label→ stone.500 · #86847DUppercase labels. 5.3:1.
--au-border-hairline→ night.750 · #1E2024Default 1px structure.
--au-dur-glide600ms
--au-ease-glidecubic-bezier(0.32, 0.72, 0, 1)Decelerates into place. Anything that moves or changes size.

Code

const [view, setView] = useState('day');

<SegmentedControl
  label="Prototype state"
  value={view}
  onChange={setView}
  options={[
    { value: 'day', label: 'Thursday' },
    { value: 'quiet', label: 'A quiet day' },
  ]}
/>