Skip to main content

Toggle Button Group

Luke van Zyl·Updated April 6, 2026

Overview

A toggle button group lets users switch between mutually exclusive views or modes. Selecting one option deselects the others. It always renders as a horizontal row of buttons inside a single bordered container.

Sandbox

Specs

Anatomy

  • Container — The bordered wrapper that groups all buttons together
  • Button — An individual selectable option within the group
  • Icon (optional) — A 20px icon representing the option, used in icon-only variants
  • Label (optional) — Short text describing the option, used in label-only variants
  • Active indicator — The light blue background fill applied to the selected button

Specs

Sizing

PropertyTokenValue
Container height--layout-height-standard-md32px
Button height--size-md24px
Icon size--icon-size-sm20px

Spacing

PropertyTokenValue
Container padding (x, y)--padding-sm4px
Button padding (x)--padding-lg8px

Border

PropertyTokenValue
Container border width--border-size-sm1px
Container border color--border-interactive-primary-enabledrgba(0,0,0,0.12)
Container border radius--border-radius-default6px

Typography (label variant)

PropertyStyleValue
Labelbody-interactive-sm12px / 500

Usage

Toggle button groups appear in a handful of specific places in Instinct. Use them when users need to switch between mutually exclusive views or modes.

  • Theme switcher on the login screen — An icon-only group lets users select light mode, dark mode, or system default before signing in.

    image.png

  • Status board header — A label-only group ("Cage Card Info" / "Tx View") controls which data view is shown for patients on the IP Board.

    image.png

  • Calendar view picker (deprecated) — Previously used to switch between Day, Week, and List views on the Business Office calendar. Included here as a reference for the icon-only pattern.

    image.png

Don't use a toggle button group when more than one option can be active at once. Use checkboxes or a tag group instead.

Best Practices

DoDon't
Use short labels, one to two words maxDon't use full phrases or sentences as button labels
Keep all buttons in a group the same width where possibleDon't mix icon-only and label-only buttons in the same group
Limit groups to two to four optionsDon't use for more than four options — reach for tabs instead
Use icon-only when icons are unambiguous and space is tightDon't use icons that require a tooltip to be understood

Accessibility

  • The container should use role="group" with an aria-label describing the purpose (e.g., aria-label="View mode").
  • Each button should carry aria-pressed="true" or aria-pressed="false" to communicate selection state to screen readers.
  • Tab moves focus through the group. Space or Enter activates the focused button.
  • Icon-only buttons require an aria-label on each button. Do not rely on the icon alone to convey meaning.
  • The active state is communicated through both background fill and foreground color. Confirm that -fg-input-controls-primary-selected meets WCAG 2.1 AA contrast against -bg-input-controls-primary-selected.
  • Disabled buttons should include aria-disabled="true" and should not receive focus.