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/Toggle

Toggle

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

Loading...

Installation

pnpm dlx shadcn@latest add https://ui.saturation.io/r/toggle.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 { 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 GroupNextTool Call Card

On This Page

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