Buttons
Data Display
Layout
Navigation
Switch
Toggle a setting on or off.
React
import { Switch } from "@isbatak/react-ui/switch"
export function SwitchDemo() {
return (
<Switch.Root defaultChecked>
<Switch.Control>
<Switch.Thumb />
</Switch.Control>
<Switch.Label>Email notifications</Switch.Label>
<Switch.HiddenInput />
</Switch.Root>
)
}Built on Ark UI's Switch, with a hidden checkbox for forms. Only React has this component so far.
Usage
import { Switch } from "@isbatak/react-ui/switch"
export function SwitchDemo() {
return (
<Switch.Root defaultChecked>
<Switch.Control>
<Switch.Thumb />
</Switch.Control>
<Switch.Label>Email notifications</Switch.Label>
<Switch.HiddenInput />
</Switch.Root>
)
}