Switch

A boolean toggle for on and off states.

Installation

import { Switch } from "@o/pipeline/experimental/components/switch";

Usage

Use a switch for a setting that takes effect as soon as it changes. It sits in the same 16px row as a glyph, so it lines up with icons and checkboxes.

With a label

Disabled

skeleton

skeleton shows the switch’s track as a placeholder while the setting it controls is loading, and makes the switch inert. The thumb doesn’t show, and when the setting arrives the thumb is set in place rather than sliding there. Inside a loading SkeletonGroup it is on by default; see Skeleton.