Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Switch

A control that allows the user to toggle between checked and not checked.

Installation

pnpm add @heyramzi/ui bits-ui

Usage

import { Switch } from "@heyramzi/ui/shadcn/switch";

Keyboard and accessibility

Key Does
Space Enter Turns the switch on or off.
  • It's a switch that reports on or off. Tie a Label to it so it has a name.

API reference

size "sm" | "default"
Default "default"
ref bindable HTMLElement | null
Default null
class string
checked bindable boolean
Default false
...rest
Every prop of Switch.Root from bits-ui except child, children
Prop Type Default
size "sm" | "default" "default"
ref bindable HTMLElement | null null
class string
checked bindable boolean false
...rest Every prop of Switch.Root from bits-ui except child, children