FormsToggle
Toggle
Toggle is similar to a two-option radio group in function but is used for quickly switching between binary actions.
ToggleProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
a11yText | { on: string; off: string } | — | { on: 'On', off: 'Off' } | Optionally pass "On" and "Off" text for screen readers. |
checked | boolean | — | false | The current checked state. |
id | string | — | — | Optionally provide an ID. |
onChange | (checked: boolean) => void | — | — | Handle change events. |
readOnly | boolean | — | false | Set the toggle to read only. This is different from disabled because the element is still accessible. |
Also accepts Omit<ButtonProps, 'onChange'> | ||||