saturation/uisaturation/ui
DocsComponentsBlocksPagesEmails
GitHub

Sections

IntroductionComponentsInstallationMCPThemingDesign

Components

Components

General

AvatarBadgeButtonKbdProgressSeparatorSkeletonSpin ResolveSpinnerSync ButtonTypography

Forms & Inputs

Address LookupCalendar PickerCheckboxComboboxDate PickerEmoji PickerFavicon SearchFieldInputInput GroupInput OTPRadio GroupSelectSliderSwitchTextareaToggleToggle Group

Data Display

AccordionAlertCardChartComparison SliderCredit CardData TableEmptyItemSaturation Credit CardTableTree

Navigation

BreadcrumbCommandMenubarNavigation MenuPaginationTabs

Overlays

CollapsibleContext MenuDialogDropdown MenuSheet

Layout

Button GroupFont ProviderWizard Split Layout

Feedback

Sonner

Animation & Effects

Animated GroupAnimated ListAnimated NumberBeamBlur FadeBorder TrailGlow EffectLiquid MetalLoading StateParallaxPixelProgressive BlurRippleSpotlightText EffectText Shimmer

Productivity

Agent ChatAI Chat InputCoding AgentFiltersFull CalendarKanbanNovel Editor
Docs/Components/Toggle

Toggle

A two-state button that can be either on or off.

Loading...

Installation

pnpm dlx shadcn@latest add @saturation-ui/toggle

Tailwind v4 — Source Scanning

The public shadcn registry installs component source into your project. 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 { Toggle } from "@/components/ui/toggle"
<Toggle>Toggle</Toggle>

Examples

Outline

Loading...
Outline variant.

Sizes

Loading...
Size variants.

Disabled

Loading...
Disabled toggle.

API Reference

PropTypeDefaultDescription
pressedboolean—The controlled pressed state.
defaultPressedboolean—The default pressed state.
onPressedChange(pressed: boolean) => void—Event handler for state changes.
variant"default" | "outline""default"The visual variant.
size"default" | "sm" | "lg""default"The size of the toggle.
PreviousToggle GroupNextTree

On This Page

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