motionsnack

Animated React sections that already feel finished.

Copy them into Next.js or add them with one command. Plain React and Tailwind, light and dark.

New sections, once a month

One short email when something new lands. No spam.

Library

  • Sections
  • Blocks
  • Components
  • Application UI
  • Templates

Popular

  • Hero
  • Gallery
  • Testimonials
  • Stats
  • Logos
  • FAQ

Resources

  • Installation
  • All components
  • All blocks
  • All sections
  • All application UI
  • Design system
  • Changelog
  • Pricing

Company

  • About
  • Contact
  • Terms
  • Privacy

Install

npx motionsnack add <name>Step-by-step guidehello@motionsnack.dev
Kuba Šťastný@kubastastnydev

© 2026 motionsnack. All rights reserved.

TermsPrivacy

motionsnack

motionsnack
DocsSectionsTemplatesWhat's newPricing
Get lifetime access
  1. Home
  2. Docs
  3. Components
  4. Switch
  5. Toggle Switch
ComponentsBlocksSectionsApplication UI
ComponentsBlocksSectionsApplication UI

Accordion

  • Spring Accordion

Alert

  • Glow Alert

Audio

  • Podcast PlayerNew
  • Voice NoteNew
  • Voice RecorderNew

Avatar

  • Avatar Stack

Badge

  • Pulse Badge

Breadcrumb

  • Slide Breadcrumb

Button

  • Chip ButtonNew
  • Glow Border Button
  • Glow ButtonNew
  • Plain ButtonNew

Calendar

  • Month Calendar

Checkbox

  • Checkbox CardsNew
  • Checkbox GroupNew
  • Chip CheckboxNew

Cropper

  • Image Cropper

Dialog

  • Spring Dialog

Dropdown

  • Command MenuNew
  • Stagger Dropdown
  • Switcher DropdownNew

File Upload

  • Drop Zone Upload

Input

  • Addon InputNew
  • Button InputNew
  • Copy InputNew
  • Date InputNew
  • Floating Label Input
  • Joined InputsNew
  • Notched Label InputNew
  • Number StepperNew
  • OTP InputNew
  • Password InputNew
  • Phone InputNew
  • Range InputNew
  • Search InputNew
  • Tag InputNew
  • Text FieldNew

Loader

  • Curtain LoaderNew
  • Greeting LoaderNew
  • Line LoaderNew
  • Meter LoaderNew
  • Split LoaderNew

Navigation Menu

  • Mobile Tab BarNew

Notification

  • Notification BellNew
  • Toast Stack

Pagination

  • Sliding Pagination

Popover

  • Spring Popover

Radio

  • Card Radio Group
  • Payment MethodNew
  • Radio GroupNew
  • Rating RadioNew

Select

  • ComboboxNew
  • Glide Select
  • Multi SelectNew
  • Rich SelectNew
  • Select FieldNew
  • Tree SelectNew

Sidebar

  • Icon RailNew

Slider

  • Glow Slider

Stepper

  • Progress Stepper

Switch

  • Billing SwitchNew
  • Switch RowNew
  • Toggle SwitchNew

Table

  • Sortable Table

Tabs

  • Sliding Tabs

Textarea

  • Auto Grow Textarea

Toggle

  • Icon ToggleNew
  • Theme ToggleNew
  • Toggle GroupNew

Tooltip

  • Follow Tooltip

Switch

Toggle Switch

New

An on/off switch with a label and description, three sizes and a thumb that stretches as you press it.

npx motionsnack add toggle-switch

Customize

Error Colour
<ToggleSwitch />

Props

18 properties

PropertyTypeDefaultDescription
checkedboolean-Controlled state. Leave undefined to let the component manage it.
defaultCheckedbooleantrueState on first render when uncontrolled.
onChange(checked: boolean) => void-Called with the new state on every change.
aria-labelstring-Accessible name when there is no visible label (ariaLabel is a deprecated alias).
namestring-Name submitted with a form.
valuestring'on'Value submitted with a form while the switch is on.
idstringgeneratedId of the input.
classNamestring''Extra classes on the wrapper.
labelstring'Public profile'Text next to the switch. Empty hides it.
descriptionstring'Anyone with the link can see your portfolio.'Second line under the label. Empty hides it.
labelPosition'right' | 'left''right'Which side of the switch the text sits on.
size'sm' | 'md' | 'lg''md'Size of the switch: S 28x16, M 36x20, L 44x24.
showIconsbooleanfalseA tiny check / cross inside the thumb that cross-fade with the state.
busybooleanfalseWaiting for an async change: a spinner in the thumb, presses are ignored.
errorstring''Error message. Any text draws the track edge in the error colour and shows the message.
errorColorstring''Overrides the per-theme error colour. Empty uses the theme pair.
requiredbooleanfalseMarks the switch as required.
disabledbooleanfalseDisables the switch.

About Toggle Switch

Toggle Switch turns a setting on or off with one click. Under the drawn track sits a real checkbox with the switch role, so the keyboard, forms and screen readers work exactly as they should. The thumb slides across on a soft ease and stretches a little toward the middle while it is held, the track fills black or white when it is on, and an optional tiny check and cross inside the thumb cross-fade with the state. A label and a second line of description sit on either side, in small, medium or large, and the switch shares the library's soft focus outline, required mark, disabled look and error state with every other field.

What's included

  • Real checkbox with the switch role underneath
  • Thumb that slides and stretches while pressed
  • Small, medium and large sizes
  • Label and description on either side
  • Optional check and cross icons in the thumb
  • Focus outline, required, disabled and error states
  • Light and dark look
Type
Animated React switch component
Library
Components · Switch
Stack
Next.js, React, Tailwind CSS
Added
2026-11-23
Install
npx motionsnack add toggle-switch