@redrob-labs/ui v1.0.2 · Redrob Group Design System 2026

Switch

Forms · src/components/Switch/Switch.tsx

Turns something on or off, and it takes effect immediately.

That is the whole difference from Checkbox: a checkbox states an intention that a Save button later commits, a switch acts now. A switch inside a form with a submit button is the wrong control.

Carries role="switch" so it is announced as on/off rather than checked/unchecked.

Import

import { Switch } from '@redrob-labs/ui';

Rendered

The design system's own preview case, run against this package's build. The parity gate compares this rendering to the reference bundle's.

Props

PropTypeNotes
label React.ReactNode
size 'sm' | 'md'
className string
children React.ReactNode

Also accepts everything on Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className' | 'type' | 'size'>.