Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

Switch

Open .md
Live preview

Loading example…

Switch is part of the Atoms set, imported from @jcsoftdev/ui/atoms.

import { Switch } from "@jcsoftdev/ui/atoms";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/atoms/switch.

<Switch aria-label="Recordatorios por WhatsApp" />
Prop Type Default Description
classNames Partial<Record<SwitchPart, string>> Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last.
checked boolean
defaultChecked boolean
onCheckedChange ((checked: boolean) => void)
required boolean
name string
value string "on"
form string Id of the <form> the switch belongs to when it is rendered outside it.
label ReactNode
description ReactNode
intent string
intentKey string

* marks a required prop.

It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).

packages/ui/src/atoms/switch/switch.tsx