Switch
A styled native checkbox with role="switch". Pass label / description to compose field helpers automatically.
Usage
Automatically switch the interface theme.
Control only
Use the bare switch when the label lives elsewhere in the layout.
Airplane mode
Disable radios and networking.
Invalid state
Enable this before saving.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
— | Composes field + field-label |
description |
string |
— | Composes field-description |
errorMessage |
string |
— | Manual error copy |
showError |
bool |
true when composed |
Render field-error |
name |
string |
— | Input name |
value |
string |
"1" |
Submitted value when on |
checked |
bool |
false |
Initial state |
errorKey |
string |
— | Override validation key |
All standard HTML attributes pass through to the control.