Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

Switch

Switch renders a token-styled boolean preference control.

CoreBasics@gaudi/design-system/core/SwitchView in StorybookSource

Installation

pnpm add github:ahmadassaf/design-system

Import from @gaudi/design-system. Load @gaudi/design-system/global.css once and add transpilePackages: ['@gaudi/design-system'] in Next.js.

import Switch from '@gaudi/design-system/core/Switch';

Copy an example into your project with the shadcn CLI: npx shadcn@latest add https://design.gaudi.site/r/switch-card-grid.json.

Usage

import { Switch } from '@gaudi/design-system';
<Switch label='Email notifications' defaultChecked />

Playground

Switch props
Props
default md
Switch.jsx
import Switch from '@gaudi/design-system/core/Switch';
<Switch label='Airplane mode' />

Examples

Card grid with descriptions

Storybook

Colours and destructive settings

Storybook

Labels and states

Storybook

Settings panel

Storybook

API

8 props

Accessibility

Switch exposes role switch, aria-checked, disabled state, and a visible label when provided.