Skip to content

Switch

A toggle control for switching between checked and unchecked states.

---
import { Label } from '@bejamas/registry/ui/label';
import { Switch } from '@bejamas/registry/ui/switch';
---
<div class="flex items-center gap-3">
<Switch id="notifications" />
<Label for="notifications">Enable notifications</Label>
</div>
Terminal window
bunx bejamas add switch
---
import { Switch } from '@bejamas/ui/components/switch';
import { Label } from '@bejamas/ui/components/label';
---
<div class="flex items-center gap-3">
<Switch id="notifications" />
<Label for="notifications">Enable notifications</Label>
</div>
Prop Type Default
class string ""
id string ""
size "sm" | "default" "default"
checked boolean
defaultChecked boolean
name string
value string
uncheckedValue string
disabled boolean false
readOnly boolean false
required boolean false
“aria-invalid” boolean | "true" | "false"