Switch
A labelled on/off switch; bind checked.
Group: Inputs · Kind: native · in the lite catalog
Preview
Section titled “Preview”example
disabled · true
Platforms
Section titled “Platforms”The same specimen painted by React, SwiftUI, Compose and gpui.




| Prop | Type | Required | Bindable | Description |
|---|---|---|---|---|
label |
string |
yes | yes | The text beside the switch. |
name |
string |
yes | – | The field’s key in the submitted data. |
checked |
boolean |
– | yes | The state; bind it. Default false. |
description |
string |
– | – | A muted line under the label. |
disabled |
boolean |
– | – | Shows it inert. Default false. |
Events
Section titled “Events”on.change: runs an action
None.
Children
Section titled “Children”none
A2UI basic mapping
Section titled “A2UI basic mapping”No basic catalog component maps here.
Built from
Section titled “Built from”A native component: every renderer paints it directly.
Accessibility
Section titled “Accessibility”Role: switch
switch; the label (and description) first, the switch at the end; the whole row toggles
| Keys | Action |
|---|---|
Space Enter |
toggle |
Theming
Section titled “Theming”Recipe parts: Switch/root Switch/track Switch/thumb Switch/label Switch/description Switch/body
Keyed by: checked disabled :hover :pressed :focus :disabled :checked :open :selected :invalid :dragover
Related
Section titled “Related”Form · FieldGroup · FormActions · Input · Textarea · NumberField · Checkbox · Radio