Toggle
A two-state button that can be either on or off.
Loading...
Features
- Full keyboard navigation.
- Can be controlled or uncontrolled.
Anatomy
API Reference
Root
RdxToggleDirective
The toggle.
Prop | Default | Type |
---|---|---|
defaultPressed | — | InputSignalWithTransform<boolean, BooleanInput> The pressed state of the toggle when it is initially rendered. Use when you do not need to control its pressed state. |
pressed | — | ModelSignal<boolean> The controlled pressed state of the toggle. Must be used in conjunction with `onPressedChange` . |
disabled | — | InputSignalWithTransform<boolean, BooleanInput> When true, prevents the user from interacting with the toggle. |
Accessibility
Keyboard Interactions
Key | Description |
---|---|
Space | Activates/deactivates the toggle. |
Enter | Activates/deactivates the toggle. |