Toggle
Color
Element | Property | Color token |
---|---|---|
Label text | text color | $text-secondary |
Action text | text color | $text-primary |
Background (off) | background-color | $toggle-off |
Handle (off) | background-color | $icon-on-color |
Background (on) | background-color | $support-success |
Handle (on) | background-color | $icon-on-color |
Checkmark | fill | $support-success |
![On and off toggle states On and off toggle states](/static/df8b284456e3459b1090ef8ca7ddcf27/3cbba/toggle-style-color.png)
On and off toggle states
Interactive states
State | Element | Property | Color token |
---|---|---|---|
Focus | Toggle | border | $focus |
Disabled | Label text | text color | $text-disabled |
Action text | text color | $text-disabled | |
Background | background-color | $button-disabled | |
Handle | background-color | $icon-on-color-disabled | |
Checkmark | inner fill | button-disabled | |
Read-only | Label text | text color | $text-secondary |
Action text | text color | $text-primary | |
Background | background-color | transparent | |
Border | border | border-subtle * | |
Handle | background-color | $icon-primary |
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Interactive toggle states Interactive toggle states](/static/d2ac7b4b16e8a69b3f69e52bdc82ebfa/3cbba/toggle-style-states.png)
Interactive toggle states
Typography
Toggle labels should be set in sentence case, with only the first word in a phrase and any proper nouns capitalized, and no more than three words.
Element | Font-size (px/rem) | Font-weight | Type token |
---|---|---|---|
Label text | 12 / 0.75 | Regular / 400 | $label-01 |
Action text | 14 / 0.875 | Regular / 400 | $body-compact-01 |
Structure
Default toggle
Element | Property | px / rem | Spacing token |
---|---|---|---|
Toggle | width | 48 / 3 | – |
height | 24 / 1.5 | – | |
Handle | height, width | 18 / 1.25 | – |
Label text | margin-top, margin-bottom | 16 / 1 | $spacing-05 |
Action text | margin-left | 8 / 0.5 | $spacing-03 |
![Structure and spacing measurements for default toggle Structure and spacing measurements for default toggle](/static/3e5716d332e1827a8bbca6d29f428c28/3cbba/toggle-style-default-spec.png)
Structure and spacing measurements for default toggle | px / rem
Small toggle
Element | Property | px / rem | Spacing token |
---|---|---|---|
Toggle | width | 32 / 2 | – |
height | 16 / 1 | – | |
Handle | height, width | 10 / 0.625 | $spacing-03 |
Action text | margin left | 8/ 0.5 | $spacing-03 |
![Structure and spacing measurements for small toggle Structure and spacing measurements for small toggle](/static/208e05be5c838c0d0285dbcf67845145/3cbba/toggle-style-small-spec.png)
Structure and spacing measurements for small toggle | px / rem
Sizes
Size | Height px / rem |
---|---|
Small (sm) | 16 / 1 |
Default | 24 / 1.5 |
![Sizes for toggle Sizes for toggle](/static/06ef1785d0d8d01403a00fba069ac968/3cbba/toggle-style-sizes.png)
Toggle sizes | px / rem