A two-state button that can be either on or off.
Full keyboard navigation.
Can be controlled or uncontrolled.
Install the component from your command line.
npm install @tealess/toggle
Import the component.
import * as Toggle from "@tealess/toggle"; export default () => <Toggle.Root />;
The toggle.
asChild
boolean
false
defaultPressed
pressed
onPressedChange
function
disabled
[data-state]
"on" | "off"
[data-disabled]
Present when disabled