saturation/uisaturation/ui
DocsComponentsBlocksPages
GitHub

Sections

IntroductionComponentsInstallationMCPTheming

Components

ComponentsAccordionAI Chat InputAlertAnimated GroupAnimated NumberAvatarBadgeBeamBlur FadeBorder TrailBreadcrumbButtonButton GroupCalendar PickerCardChartCheckboxCollapsibleComboboxCommandComparison SliderContext MenuCredit CardData TableDate PickerDialogDropdown MenuEmoji PickerEmptyFieldFiltersFull CalendarGlow EffectInputInput GroupInput OTPItemKanbanKbdMenubarNavigation MenuNovel EditorPaginationParallaxProgressProgressive BlurRadio GroupRippleSelectSeparatorSheetSkeletonSliderSonnerSpinnerSpotlightSwitchTableTabsText EffectText ShimmerTextareaToggleToggle GroupTreeTypography
Docs/Components/Switch

Switch

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

Loading...

Installation

pnpm dlx shadcn@latest add https://ui.saturation.io/r/switch.json

Tailwind v4 — Source Scanning

Saturation UI copies component source into your project via the shadcn registry (no npm package). If Tailwind v4 isn't scanning your components directory, add this to your CSS entry file:

@source "../components";

This ensures all utility classes in CVA variants and data attribute selectors are included in your build.

Usage

import { Switch } from "@/components/ui/switch"
<Switch />

Examples

Disabled

Loading...
Disabled state.

Sizes

Loading...
Size variants.

API Reference

PropTypeDefaultDescription
checkedboolean—The controlled checked state.
defaultCheckedboolean—The default checked state.
onCheckedChange(checked: boolean) => void—Event handler for state changes.
PreviousStep TimelineNextTable of Contents

On This Page

  • Installation
  • Usage
  • Examples
  • Disabled
  • Sizes
  • API Reference