Stop Rebuilding UI

Shadcn.io is not affiliated with official shadcn/ui

Checked Switch

Switch toggle with defaultChecked prop to set initial checked state without controlled state management built with shadcn/ui

Sometimes you need a toggle that starts on—user preferences remembered, features enabled by default, opt-out settings. This React switch uses defaultChecked prop with shadcn/ui Switch component for uncontrolled initial state. Built with Radix UI primitives, it starts checked but users can toggle freely without React state management—perfect for default-on features, remembered preferences, opt-out checkboxes, or any interface where initial checked state matters but you don't need to track changes in React until form submission.

Checked Switch preview

Scroll to load preview

Installation

FAQ

Was this page helpful?

Sign in to leave feedback.