Toggle

Live example


Properties

Name

Values

Default

id (required for web)

string

 

label

string

 

hint

string

 

error

string

 

labelPosition

'left' | 'right'

'left'

optional

boolean

false

onChange

Function

 

'aria-describedby'

string | undefined

 

…

JSX.IntrinsicElements['input']

 

Native Properties

Name

Values

Default

label

string | ReactNode

 

checked

boolean

false

inline

boolean

 

hint

ReactNode

 

labelPosition

'left' | 'right'

'left'

activeOpacity

number

0.8

…

Omit<TouchableOpacityProps, 'children'>

 


Composition

Toggle composition 1
  1. Text
  2. Toggle
Toggle composition 2

 

Tokens

 

Toggle background colour - Inactive, active

color.surface.onsurfacevariant input.color.selected

Toggle foreground colour

color.surface.bright

Text colour

color.surface.onsurface

Hint text colour

color.surface.onsurfacevariant

Text font weight

font.family.bold

Hint text font weight

font.family.book

Text size

font.size.md

Text line height

font.lineheight.md

Toggle border radius

border.radius.2xl

Padding

space-100 space-200