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
backgroundColorby overwriting theswitchActiveColorvariable. You can change the inactivebackgroundColorby overwriting theswitchInactiveColorvariable. You can change the thumb color by overwriting theswitchThumbColorvariable. Read more about this here.
JSX Declaration
<Switch
value={this.state.switch}
onValueChange={(value) => console.log('Switch value', value) }
/>
Snack Example
Coming soon.