Skip to content

SegmentedControl

Stable

A row of joined buttons where you pick one option, using clicks or arrow keys.

Also known as segmented button, toggle group, button group, radio buttons

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Default size

A group of three options.

When to use it

A row of joined buttons for picking one of a few short options. All the options stay in view, so people see their choice next to the others.

Made of: Group · Option buttons

Use it for

  • Two to five short options where only one can be chosen, such as a length or a view.
  • A setting inside a crowded row: use the small size.
  • Switching between two versions of the same content.

Not for

  • Turning one thing on or off: use Switch.
  • Running an action: use Button.
  • Many options that will not fit on one line.

Do and avoid

Do. Two views side by side, and one tap switches between them.
Avoid. On and off as two segments reads less clearly than a switch.

Do

  • Use it for two to five short options where only one can be chosen.
  • Give the group a name that says what is being chosen.
  • Keep words short so the group stays on one line.
  • Use the small size inside crowded rows.

Avoid

  • Do not use it for actions. Use buttons.
  • Do not use it for many options. The group does not wrap to a new line.
  • Do not choose a value that is not in the list. Nothing would be reachable with Tab.
  • Do not use it for on and off. Use Switch.

On a phone

  • The options sit in one row that scrolls sideways when it is wider than the screen, so keep to two or three short labels to avoid hidden options.
  • Each option keeps its size and has a 44px tap area on a touch screen.
  • An option description is set as a title only, which a finger cannot show.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started