Pulse
Pulse

Components

Switch

A beautiful track-and-thumb toggle control representing binary states.

Playground

Size

Disabled

Basic Switch

Simple Toggle

Interactive toggle without an inline label.

With Label

Inline Label

Implicit wrapping for simple mouse clicking target enhancement.

Sizes

States

Loading

Async Setting

Simulates a 1.2s save round-trip before the toggle settles.

Props

PropTypeDefaultDescription
checkedbooleanfalseSets the toggled state of the switch.
onChange(checked: boolean) => void—Callback fired when toggle state changes.
disabledbooleanfalseDisables interaction and applies visual opacity.
loadingbooleanfalseShows a spinner in place of the thumb and blocks interaction — for an async toggle mid-flight.
size"sm" | "md""md"Controls the scale/dimension of the switch track.
labelstring—Optional label rendered to the right of the switch control.

Usage Guidelines

When to use

  • Use for a setting that takes effect immediately on toggle, with no separate Save step — e.g. enabling notifications.

When not to use

  • Don't use Switch inside a form that needs an explicit Save/Submit before the change applies — that mismatch confuses users about whether the toggle already did something.
  • Don't use Switch for more than two states — that's Segmented Control's job.

Usage