inputs
Switch
Radix UI ベースのトグルスイッチ。ラベルやエラー状態の表示に対応。
インポート
import { Switch } from '@stella-ds/react'Props
| Prop | 型 | デフォルト | 説明 |
|---|---|---|---|
| size | 'sm' | 'md' | 'lg' | 'md' | Size preset |
| label | ReactNode | undefined | Label beside the switch |
| error | boolean | false | Error state |
Preview
使用例
With label
<Switch label="Enable notifications" defaultChecked />
<Switch label="Dark mode" size="sm" />