Skip to Content
ComponentsSwitch

Switch

A toggle switch control built on Ark UI with multiple sizes.

Import

import { Switch } from '@grannyshot/ui'

Usage

<Switch label="Enable notifications" />

Sizes

<Switch size="sm" label="Small" /> <Switch size="md" label="Medium" /> <Switch size="lg" label="Large" />

Default Checked

<Switch label="Enabled by default" defaultChecked />

Disabled

<Switch label="Disabled" disabled /> <Switch label="Disabled on" disabled defaultChecked />

Props

PropTypeDefaultDescription
labelstringSwitch label text
size'sm' | 'md' | 'lg''md'Switch size
checkedbooleanControlled checked state
defaultCheckedbooleanfalseInitial checked state
disabledbooleanfalseDisabled state
classNamestringAdditional CSS classes
Last updated on