Komponents
Components

Components

Switch

Immediate on/off control for preferences and modes.

newfree
pnpm add @komponents/uiCanonical TypeScript source · tree-shakeable subpaths

Switch is for instant settings, not delayed form commits. Thumb travel uses CSS transform transitions.

Usage

Snippet
import { Switch } from "@komponents/ui";

<Switch defaultSelected>Enable motion</Switch>

States

  • Selected / unselected
  • Disabled
  • Press scale feedback

Accessibility

  • Native switch role
  • Space toggles value
  • Focus-visible ring on the track

On this page