Toggle Group

Toggle buttons can be used to put together related options that share a common attribute modification. It allows the user to switch from one selected option to another in the same control, having one option selected at a time. Also, there can be another variation that allows selecting multiple options from the current toggle group.

Specifications

Toggle design specifications
Toggle group design specifications

States

Different states are defined in the life cycle of the component: unselected enabled, unselected hover, unselected focus, unselected active, unselected disabled, selected enabled, selected hover, selected focus, selected active and selected disabled

Toggle button states
Toggle button states

Anatomy

Toggle group anatomy
  1. 1.
    Label
  2. 2.
    Helper text
  3. 3.
    Container
  4. 4.
    Button
  5. 5.
    Button icon
  6. 6.
    Button label

Design tokens

Color

Component tokenElementCore tokenValue
labelFontColorLabelcolor-black#000000
disabledLabelFontColorLabel:disabledcolor-grey-500#999999
helperTextFontColorHelper textcolor-black#000000
disabledHelperTextFontColorHelper text:disabledcolor-grey-500#999999
containerBackgroundColorContainercolor-grey-50#fafafa
containerBorderColorContainercolor-grey-500#999999
unselectedBackgroundColorButton fill:enabledcolor-grey-200#e6e6e6
unselectedHoverBackgroundColorButton fill:hovercolor-grey-300#cccccc
unselectedActiveBackgroundColorButton fill:activecolor-purple-700#5f249f
unselectedDisabledBackgroundColorButton fill:disabledcolor-grey-100#f2f2f2
unselectedFontColorButton labelcolor-black#000000
unselectedDisabledFontColorButton label:disabledcolor-grey-500#999999
selectedBackgroundColorButton fill:enabledcolor-purple-700#5f249f
selectedHoverBackgroundColorButton fill:hovercolor-purple-800#4b1c7d
selectedActiveBackgroundColorButton fill:activecolor-purple-900#321353
selectedDisabledBackgroundColorButton fill:disabledcolor-purple-100#f2eafa
selectedFontColorButton labelcolor-white#ffffff
selectedDisabledFontColorButton label:disabledcolor-purple-300#cbacec
focusColorFocus indicatorcolor-blue-600#0095ff

Typography

Component tokenElementCore tokenValue
labelFontFamilyLabelfont-family'Open Sans', sans-serif
labelFontSizeLabelfont-scale-020.875rem / 14px
labelFontStyleLabelfont-style-normalnormal
labelFontWeightLabelfont-weight-semibold600
labelLineHeightLabelfont-leading-loose-011.715em
helperTextFontFamilyHelper textfont-family'Open Sans', sans-serif
helperTextFontSizeHelper textfont-scale-010.75rem / 12px
helperTextFontStyleHelper textfont-style-normalnormal
helperTextFontWeightHelper textfont-weight-regular400
helperTextLineHeightHelper textfont-leading-normal1.5em
optionLabelFontFamilyButton labelfont-family'Open Sans', sans-serif
optionLabelFontSizeButton labelfont-scale-031rem / 16px
optionLabelFontStyleButton labelfont-style-normalnormal
optionLabelFontWeightButton labelfont-weight-regular400

Spacing

Component tokenElementCore tokenValue
iconPaddingRightIconspacing-80.5rem / 8px
iconPaddingLeftIconspacing-80.5rem / 8px
labelPaddingLeftLabel (Label + icon)spacing-241.5rem / 24px
labelPaddingRightLabel (Label + icon)spacing-241.5rem / 24px
iconMarginRightIcon (Label + icon)spacing-80.5rem / 8px
containerMarginTopContainerspacing-40.25rem / 4px

Border

PropertyElementCore tokenValue
border-widthButtonborder-width-00
border-styleButtonborder-style-nonenone
border-radiusButtonborder-radius-medium0.25rem / 4px
border-widthContainerborder-width-11px
border-styleContainerborder-style-solidsolid
border-radiusContainer-0.375rem / 6px
border-widthFocus borderborder-width-22
border-styleFocus borderborder-style-solidsolid
border-radiusFocus borderborder-radius-medium0.25rem / 4px

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