Switch

A switch is a component which is used to toggle the state of a single item between on or off.

We use native Android and iOS switch components in combination with PARKSIDE brand colors.


Recommendations#

  • Use switches inside list components only.
  • Don't place any labels to describe the state of the switch – it is either on or off.

Android switch#

☀ Light mode styling for Android#

 StatesAttributesPreview
offknob-color: basic/white
background-color: greyscale/light-mode/general/low-contrast
toggle-switch off
onknob-color: brand-primary/base
background-color: brand-primary/light
toggle-switch on
on-disabledopacity: 38%
knob-color: brand-primary/base
background-color: brand-primary/light
disabled toggle-switch on
off-disabledopacity: 38%
knob-color: basic/white
background-color: greyscale/light-mode/general/low-contrast
disabled toggle-switch off

☾ Dark mode styling for Android#

 StatesAttributesPreview
offknob-color: greyscale/dark-mode/general/medium-contrast
background-color: greyscale/dark-mode/general/low-contrast
toggle-switch off
onknob-color: brand-primary/base
background-color: brand-primary/light
toggle-switch on
on-disabledopacity: 38%
knob-color: brand-primary/base
background-color: brand-primary/light
disabled toggle-switch on
off-disabledopacity: 38%
knob-color: greyscale/dark-mode/general/medium-contrast
background-color: greyscale/dark-mode/general/low-contrast
disabled toggle-switch off

iOS switch#

☀ Light mode styling for iOS#

 StatesAttributesPreview
offknob-color: basic/white
background-color: greyscale/light-mode/general/extra-low-contrast
toggle-switch off
onknob-color: basic/white
background-color: brand-primary/base
toggle-switch on
on-disabledopacity: 38%
knob-color: basic/white
background-color: brand-primary/base
disabled toggle-switch on
off-disabledopacity: 38%
knob-color: basic/white
background-color: greyscale/light-mode/general/extra-low-contrast
disabled toggle-switch off

☾ Dark mode styling for iOS#

 StatesAttributesPreview
offknob-color: basic/white
background-color: greyscale/dark-mode/general/low-contrast
toggle-switch off
onknob-color: basic/white
background-color: brand-primary/base
toggle-switch on
on-disabledopacity: 38%
knob-color: basic/white
background-color: brand-primary/base
disabled toggle-switch on
off-disabledopacity: 38%
knob-color: basic/white
background-color: greyscale/dark-mode/general/low-contrast
disabled toggle-switch off

2.1.0 Parkside - 2021-11-15#

Added#

  • Figma, Doc: "Switch" | Switch component is available