sigilUI

Switch

Turn a setting on or off.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { Switch } from "@sigil-ui/components";

Usage

<div className="flex flex-col gap-3">
    <Switch label="Email notifications" defaultChecked />
    <Switch label="Push notifications" />
    <Switch label="SMS alerts" disabled />
  </div>

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg"——
labelstring——
thumbIconReactNode—Content rendered inside the thumb (e.g. an icon).
thumbClassNamestring—Additional classes applied to the thumb element.

Token integration

CSS VariablePurpose
--s-radius-fullRadius full
--s-borderBorder
--s-primaryPrimary
--s-duration-fastDuration fast
--s-ringRing
--s-ring-offsetRing offset
--s-backgroundBackground
--s-shadow-smShadow sm
--s-textText