LiftDesign System
Beta
한국어 Get started
  1. Components
  2. Product
  3. Switch

Components / Product

Switch — Implementation

Immediate on/off

Context
Product
Content
source-derived
Availability
implemented
Verification
static-only 2026-11-18
Source revision
Lift 1.2.3 59fc087f3990…
Source language
EN · not translated

Supported environment

The Lift 1.2.3 reference implementation is a React 18 function component with inline styles referencing Product tokens (hsl(var(--*))), so styles.product.css must be loaded. The mapping to an npm package could not be verified in this repository.

API

Copied from SwitchProps in components/_types.d.ts.

proptypedefaultdoc
checkedboolean—
defaultCheckedbooleanfalse
onChange(checked: boolean) => void—
disabledbooleanfalse
labelReact.ReactNode—
describedBystring—보조 설명 요소의 id (aria-describedby).
styleReact.CSSProperties—

Code

One import line plus the example code from the usage note.

jsx · import
import { Switch } from "./components/forms/Switch.jsx";
jsx · Switch.prompt.md
<Switch defaultChecked label="Streaming responses" />

Token bindings

Tokens the implementation references with var(). Names assembled at runtime (e.g. --state-${tone}-fg) are not listed.

--duration-fast, --ease-standard, --font-sans, --foreground, --primary, --shadow-sm, --switch-thumb, --switch-track-off, --transition-colors

Source