Switch
API
Props
Declaration | Description | Type | Default | Required |
---|---|---|---|---|
value | Default state value | Boolean | false | false |
onValueChange | Function to be called when value changes | Function(value: Boolean) | (): void | true |
Style names
Switch
doesn’t have specific style names.
Note You can change the active
backgroundColor
by overwriting theswitchActiveColor
variable. You can change the inactivebackgroundColor
by overwriting theswitchInactiveColor
variable. You can change the thumb color by overwriting theswitchThumbColor
variable. Read more about this here.
JSX Declaration
<Switch
value={this.state.switch}
onValueChange={(value) => console.log('Switch value', value) }
/>
Snack Example
Coming soon.