Tangible Design System · @tangible/ui 0.2.29 · Interactive version · Markdown

Switch

import { Switch } from '@tangible/ui';

Interactive docs and examples: Switch in Storybook.

Switch props

Prop Type Default Description
checked? boolean
className? string
defaultChecked? boolean false
disabled? boolean
label? ReactNode
onCheckedChange? (checked: boolean) => void
size? "lg" | "md" | "sm" 'md'

Also accepts the standard attributes of ButtonHTMLAttributes (data-*, aria-*, event handlers), passed to the element it renders.

Examples

Other stories: Basic, Checked By Default, Disabled, Disabled Checked, Controlled, Sizes (interactive page).

Component API tokens

Read via fallback, never declared. Set one on an ancestor to restyle every instance under it.