Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Tailwind CSS Switch/Toggle

Build Tailwind CSS switch and toggle components with descriptions, disabled states, icons, tooltips, colors, rounded shapes, sizes, and form validation.

Heads up!

By default Preline UI uses Tailwind CSS Forms plugin. Don't forget to install it!

Default switch

Use the default switch to toggle a single setting on or off.

Switch with description

Pair a switch with supporting text when the setting needs a little more context.

Disabled switch

Disable a switch to show a setting that is unavailable or read-only.

Switch sizes

Scale the switch from compact to large sizes to fit different interfaces.

Switch with icons

Add icons inside the switch to make the on and off states easier to scan.

Soft color variants

Use softer color treatments for a lower-contrast switch style.

Corner radius

Adjust the corner radius to create squared, slightly rounded, or more pill-like switches.

Rounded with icons

Combine rounded switch styles with icons inside the track for clearer on and off states.

Switch with tooltip

Attach a tooltip when the setting needs extra context without adding persistent copy.

Validation states

Show valid and invalid states to give clear feedback when a switch is required in a form.

© 2026 Preline Labs.