RUI.next

Data-Entry
Switch

Switch

Switch is the section to be able to select between two status (On/Off).

<Switch checked />
<Switch checked />

Example

Basic usage of Switch component.

Default switch (Style for iOS)
Disabled off
Disabled on
Style for android

API

PropertiesDescriptionTypeDefault
checkedWhether is checked by defaultBooleanfalse
disabledwhether is disabledBooleanfalse
colorBackground color when the switch is turned on.String#4dd865
onChangeThe callback function that is triggered when the selected state changes.(checked: boolean) => void-
namename of switchString-
platformset the special style depends on platform, Options android, ios (by default)Stringios