Forms that are submitted together, or multiple selection
States
State
Appearance
off
Background bg, one-dot shadow
on
Background primary (switch knob on the right / check mark)
pressed
Shadow removed, body shifts down by one dot
focused
One-dot focus ring
disabled
Disabled colors
React API
Prop
Description
variant="switch"
"switch" (default, role="switch") or "checkbox"
checked / onChange(checked, event)
onChange receives the new boolean first, so onChange={setWifi} works
children
The label. Clicking it toggles too. Without a visible label, pass aria-label
…input props
Any checkbox <input> attribute (name, value, disabled, defaultChecked, …)
SwiftUI API
API
Description
.toggleStyle(.dotwear)
Switch
.toggleStyle(.dotwear(.checkbox))
Checkbox
React Native API
Prop
Description
variant="switch"
"switch" (default, accessibilityRole="switch") or "checkbox"
value / onValueChange(value)
Same as the standard Switch, so onValueChange={setWifi} works
children
The label. Tapping it toggles too. Without a visible label, pass accessibilityLabel
…Pressable props
disabled, accessibilityLabel, style, …
Flutter API
Parameter
Description
value / onChanged
Same as the standard Switch. onChanged: null disables it
variant: DotwearToggleVariant.switch_
.switch_ (default) or .checkbox
child
The label. Tapping it toggles too. Without a visible label, pass semanticLabel
Accessibility
Web: a standard checkbox <input> (role="switch" for the switch) wrapped in a <label>, so Space toggles it and clicking the label works.
iOS: VoiceOver announces it exactly like a standard Toggle ("Switch, on"), for both looks.
React Native: a Pressable with accessibilityRole="switch" or "checkbox" and accessibilityState.checked, so VoiceOver and TalkBack announce the role and state. The label and control are one element.
Flutter: reports toggled (switch) or checked (checkbox) like the standard Switch and Checkbox, and Space or Enter toggles it.