Button Switchers

Button switchers help people select one of two options or switch between two views.

Variations

Basic button switchers

copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone

Fully rounded button switchers

copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone
copydone

Usage

Button switchers can have two segments. Each segment is clearly divided and contains label text, an icon, or both.

Specs

Button switchers come in 6 styles (basic, leading icon, trailing icon, basic rounded, leading icon rounded and trailing icon rounded) They can contain text, leading or trailing icons. All variations come in 3 sizes:

  • Small: 2rem height (32px), 1rem (16px) horizontal padding and 0.75rem (12px) font size. Icons on small buttons are 1rem (16px) wide and tall and have a 0.5rem (8px) distance from the text.
  • Base: 2.5rem height (40px), 1.25rem (20px) horizontal padding and 0.875rem (14px) font size. Icons on base buttons are 1.25rem (20px) wide and tall and have a 0.5rem (8px) distance from the text.
  • Large: 3rem height (48px), 1.5rem (24px) horizontal padding and 0.875rem (14px) font size. Icons on large buttons are 1.25rem (20px) wide and tall and have a 0.5rem (8px) distance from the text.

Accessibility notes

Button switchers are built with the native <input type="checkbox"> element. Two labels to express the states are used and point to the same input element.