ComponentsBlocksDocsExamples

Accordion
Field
Accordion Menu
Alert Dialog
Avatar
Badge
Breadcrumb
Button
Carousel
Checkbox
Collapsible
Command
Combobox
Context Menu
Date Picker
Dialog
Dropdown Menu
Form
Filters
New
Hover Card
Input
Update
Label
Menubar
Navigation Menu
Popover
Progress
Radio Group
Scroll Area
Select
Separator
Sheet
Slider
Sortable
Switch
Table
Tabs
Tooltip
Toggle
Toggle Group
Tree

Components

Switch

UI Library:

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

Open in
Loading

Installation

pnpm dlx shadcn@latest add @toui/switch

Examples

Disabled

Open in
Loading

Square

Size

Open in
Loading

Indicator

Icon

Open in
Loading

Button

Advanced Label

Form

Open in
Loading

API Reference

This component is built using Radix UI Switch primitives. For detailed information, please visit the full API reference.

Switch

This component is based on the Switch.Root primitive and includes the following custom props:

PropTypeDefault
shape enum "pill"
size enum "md"
thumbClassName stringundefined

SwitchWrapper

This is a custom component that provides context for permanent state and layout.

PropTypeDefault
permanent booleanfalse
className stringundefined

SwitchIndicator

This is a custom component that provides visual indicators for the switch states.

PropTypeDefault
state enum "off"
className stringundefined

Credits

  • Built with Radix UI Switch.
PreviouseSortableNextTable

On This Page

  • Installation
  • Examples
    • Disabled
    • Square
    • Size
    • Indicator
    • Icon
    • Button
    • Advanced Label
    • Form
  • API Reference
    • Switch
    • SwitchWrapper
    • SwitchIndicator
  • Credits

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking Accept, you agree to our use of cookies.
Learn more.

Token UI

Components

  • Overview
  • Pricing
  • Marketplace
  • Features
  • Integrations
  • Pricing

Blocks

  • Charts
  • Team
  • Blog
  • Careers
  • Contact
  • Privacy

Examples

  • Help
  • Sales
  • Advertise

Docs

  • Twitter
  • Instagram
  • LinkedIn

© 2025 TOUI.dev. All rights reserved.

  • Terms and Conditions
  • Privacy Policy