Switch

The Switch component is used as an alternative for the Checkbox component. Except indeterminate and label are not supported.

Component NameDevelopment Status
SwitchDONE

Examples

You can find all examples for components developed in this module here.

Basic Switch Example

Very basic Switch component examples.

Property NameTypeDescription
idstringThe id attribute of the checkbox.
namestringThe name attribute of the checkbox.
valuestringThe value attribute of the checkbox.
checkedboolWhen true, the switch is checked (on).
onChange - () => {}funcFunction called when state changes.
disabled - falseboolWhen true, the switch is disabled.
hasCheckIcon - trueboolWhen true, the switch has a check icon.
defaultCheckedboolWhen true, the switch is true by default. This is for uncontrolled usage.