Switches
Toggle switches with sizes, color variants, inner icons/text, label placement, soft variants, and four visual styles (iOS / Android / Material 3 / Ant Design).
Basic Switches
States
Sizes
Color Variants
Contextual Label Colors
Switch with Inner Icons
Switch with Inner Text
Switch with Icon + Text
iOS-Style Switches
Clean, rounded iOS-inspired switch with a slightly larger thumb and iOS-native system colors.
Default iOS switch
iOS color variants
iOS sizes
Android / Material Design 2
Material Design 2 — thin track with an elevated thumb that hangs above it.
Material 3
Material Design 3 — outlined track, larger thumb that grows on checked state.
Ant Design
Ant Design — slightly taller track, clean shadow.
Label Placement
Position the label end (default), start, top, or bottom relative to the switch.
Soft Switches
Soft variant with a muted track background and the variant color applied only to the thumb.
CSS reference
| Class | Purpose |
|---|---|
.lp-switch | Wrapper label containing a hidden <input type="checkbox"> + track + label |
.lp-switch-track | The visible pill-shaped track; contains the thumb (via ::before) and optional on/off content |
.lp-switch-label | Label text (required for contextual label variant) |
.lp-switch-on / .lp-switch-off | Inner content shown on the checked / unchecked side of the track |
.lp-switch-sm / -lg | Size variants |
.lp-switch-{primary|secondary|success|danger|warning|info} | Filled color variants |
.lp-switch-soft-{color} | Soft variant — muted track, colored thumb |
.lp-switch-label-contextual | Tints label text to match color variant when checked |
.lp-switch-icon / -text / -icon-text | Wider track with inner icon, text, or both |
.lp-switch-label-{start|top|bottom} | Label placement variants |
.lp-switch-ios (+ -sm/-lg/-primary/-success/…) | iOS-style switch with system colors |
.lp-switch-android | Material Design 2 style — thin track with elevated thumb |
.lp-switch-m3 | Material Design 3 style — outlined track, growing thumb |
.lp-switch-antd | Ant Design style |