Skip to content

7 Free Bootstrap & Tailwind Toggle & Switch Templates

On/off switches and toggle buttons.

7 components

Toggler Button Demos – free Bootstrap 6 toggle & switch template

Toggler Button Demos

Four Bootstrap 6 Toggler demos on a dark panel: a favorite heart, a read-more expander, a light/dark theme preview and a grid/list view switch, all with data attributes.

Settings Panel with Switches – free Bootstrap 6 toggle & switch template

Settings Panel with Switches

Bootstrap 6 notification settings panel with switches grouped in cards, master switches per group, a pause-all toggle, unsaved-change tracking and a simulated save.

Neumorphic Toggle Switch – free Pure CSS toggle & switch template

Neumorphic Toggle Switch

Pure CSS neumorphic toggle switches with inset shadow tracks, raised knobs and glowing indicators, built on accessible native checkboxes.

Toggle Switches with Labels – free Bootstrap 6 toggle & switch template

Toggle Switches with Labels

Dark Bootstrap 6 settings panel with .switch toggles in three sizes, labels with descriptions, disabled states and a simulated auto-save status.

Settings Toggles with Description – free Tailwind CSS toggle & switch template

Settings Toggles with Description

Tailwind CSS settings panel with accessible switches, label descriptions, a locked required option, restore defaults and an auto-save status message.

Day/Night Toggle – free Pure CSS toggle & switch template

Day/Night Toggle

Animated pure CSS day and night toggle switch where the sun turns into a cratered moon, clouds drift away and stars appear.

iOS Style Toggle Switch – free Pure CSS toggle & switch template

iOS Style Toggle Switch

Pure CSS iOS style toggle switches built on real checkboxes, in a grouped settings list with three sizes, five colors and a disabled state.

What is a toggle switch?

A toggle switch is an on/off control that looks like a physical switch. It is used for settings that take effect immediately, such as enabling notifications, dark mode, or a feature flag. This category also covers toggle buttons and segmented on/off controls, for example a monthly and yearly billing toggle on a pricing page.

When to use a switch

  • For binary settings that apply instantly, without a save button.
  • In settings pages and preference panels with many independent options.
  • For view toggles such as "show archived" or "compact mode".
  • Use a checkbox instead when the value is only applied after submitting a form.

Best practices

  • Build switches on a native <input type="checkbox"> with role="switch", or a <button> with role="switch" and aria-checked.
  • Always provide a visible label that describes the setting, not the state. "Email notifications" is better than "On".
  • Show the state with more than colour: knob position, an icon or on/off text inside the track.
  • Make the hit area at least 44 by 24 pixels and let users click the label too.
  • Keep a clear :focus-visible style; custom switches often lose the default outline.
  • Animate the knob with transform for smooth performance, and reduce or remove motion under prefers-reduced-motion.
  • If the change is saved to a server, give feedback when it succeeds or fails.

Framework versions

The toggle switch examples here include simple switches, switches with icons and labels, large mobile-friendly switches and pricing toggles. Bootstrap 6 versions use theme-* colour roles for the active track. Bootstrap 5 versions use .form-switch with .form-check-input, Tailwind CSS versions use peer and peer-checked: variants, and the pure CSS toggle switch versions need no JavaScript. Use the live preview to compare them, then copy or download the HTML and CSS and rename the labels for your settings.