Switch

Switch toggles are elements that can get two simple states, each of them has an impact on the system and it can be switched on or off, there are no more options. If the switch toggle is on one state, the action to change it will modify to value of the element to the contrary.

Specifications

Switch design specifications
Switch design specifications
Switch stacking design specifications
Switch stacking design specifications

States

Five different states are defined in the life cycle of the component: unselected enabled, unselected focus, unselected disabled, selected enabled, selected focus and selected disabled.

Switch states
Switch states

Anatomy

Switch anatomy
  1. 1.
    Label
  2. 2.
    Thumb
  3. 3.
    Track

Design tokens

Color

Component tokenElementCore tokenValue
labelFontColorLabelcolor-black#000000
disabledLabelFontColorLabel:disabledcolor-grey-500#999999
checkedThumbBackgroundColorThumb checkedcolor-white#ffffff
checkedTrackBackgroundColorTrack checkedcolor-purple-700#5f249f
uncheckedTrackBackgroundColorTrack uncheckedcolor-grey-400#bfbfbf
uncheckedThumbBackgroundColorThumb uncheckedcolor-white#ffffff
disabledCheckedTrackBackgroundColorTrack:disabled checkedcolor-purple-100#f2eafa
disabledUncheckedTrackBackgroundColorTrack:disabled uncheckedcolor-grey-100#f2f2f2
disabledCheckedThumbBackgroundColorThumb:disabled checkedcolor-white#ffffff
disabledUncheckedTrackBackgroundColorTrack:disabled uncheckedcolor-grey-100#f2f2f2
disabledUncheckedThumbBackgroundColorThumb:disabled uncheckedcolor-white#ffffff
thumbFocusColorThumb:focuscolor-blue-600#0095ff

Typography

Component tokenElementCore tokenValue
labelFontFamilyLabelfont-family-sansOpen sans
labelFontSizeLabelfont-scale-021rem / 16px
labelFontWeightLabelfont-weight-regular400
labelFontStyleLabelfont-style-normalnormal

Size

Component tokenElementCore tokenValue
thumbHeightThumb-24px
thumbWidthThumb-24px
trackHeightTrack-12px
trackWidthTrack-36px
focusHeightFocus indicator-40px
focusWidthFocus indicator-40px

Border

PropertyElementCore tokenValue
border-widthTrackborder-width-00
border-styleTrackborder-style-nonenone
border-radiusTrackborder-radius-full9999px
border-widthThumbborder-width-00
border-styleThumbborder-style-nonenone
border-radiusThumbborder-radius-full9999px
border-widthFocus borderborder-width-22px
border-styleFocus borderborder-style-solidsolid
border-radiusFocus borderborder-radius-full9999px

Margin

MarginValue
xxsmall6px
xsmall16px
small24px
medium36px
large48px
xlarge64px
xxlarge100px

And also apply different values to each side of the component: top, bottom, left and right.

Spacing

PropertyElementCore tokenValue
paddingThumbspacing-80.5rem / 8px
margin-left/right*Switchspacing-80.5rem / 8px
paddingTrackspacing-120.75rem / 12px

*Depending on the position of the label