Toggle

Stable
Last updated Jun 23, 2026

A toggle is used to quickly switch between two possible states. They are commonly used for "on/off" switches.

Toggle

Color

Both the default and small toggle variants share the same color and interactive state properties.

Element

Property

Color token

Label text

text-color

$text-secondary

State 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

Toggle color with feature flag enabled

Interactive state color

The default and small toggle can be switched on and off across focus, disabled, and read-only states.

State

Element

Property

Color token

Focus

Toggle

border

$focus

Disabled

Label text

text-color

$text-disabled

State 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

State 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.

Toggle with flag enabled, minimizing spacing between the label and toggle

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

State text

14 / 0.875

Regular / 400

$body-compact-01

Structure

Default toggle structure

Element

Property

px / rem

Spacing token

Toggle

width

48 / 3

height

24 / 1.5

Handle

height, width

18 / 1.25

Label text (feature flag)

margin-top, margin-bottom

8 / 0.5

$spacing-03

Label text

margin-top, margin-bottom

16 / 1

$spacing-05

State text

margin-left

8 / 0.5

$spacing-03

Toggle structure with flag enabled

Structure and spacing measurements for default toggle with a feature flag enabled | px / rem

Toggle structure with flag disabled

Structure and spacing measurements for default toggle with a feature flag disabled | px / rem

Small toggle structure

Element

Property

px / rem

Spacing token

Toggle

width

32 / 2

height

16 / 1

Handle

height, width

10 / 0.625

Label text (feature flag)

margin-top, margin-bottom

8 / 0.5

$spacing-03

Label text

margin-top, margin-bottom

16 / 1

$spacing-05

State text

margin left

8 / 0.5

$spacing-03

Small toggle structure with flag enabled

Structure and spacing measurements for small toggle with a feature flag enabled | px / rem

Small toggle structure with flag disabled

Structure and spacing measurements for small toggle with a feature flag disabled | px / rem

Size

Size

Height (px / rem)

Small (sm)

16 / 1

Default

24 / 1.5

Toggle sizes between default and small

Default and small sizes of toggle | px / rem

Feedback

Help us improve this component by providing feedback, asking questions, and leaving any other comments on GitHub.