Switch
A Switch allows a user to immediately toggle interface settings.
import { ... } from '@ag.ds-next/react/switch';Usage
Switch components can be imported via the switch entrypoint in the @ag.ds-next/react package.
For example:
import { ... } from '@ag.ds-next/react/switch';Props
| Prop | Type | Description |
|---|---|---|
| checked | boolean | The current checked state. |
| label | string | The associated label for the switch. |
| onChange | (newValue: boolean) => void | Handle change events. |
| aria-controls? | string | |
| size? | SwitchSizeDefault: "md" | The size of the switch. |
Source
You can view the full source code for this package on Github.