Forge Docs
FormSwitchField

SwitchField

スイッチフィールドコンポーネント

概要

トグルスイッチフィールド。ラベルと説明が左側、スイッチが右側に配置される。

Storybook で確認

Props

Prop必須説明
labelstringYesフィールドラベル
descriptionstringヘルパーテキスト
checkedboolean制御値
defaultCheckedboolean初期値
onCheckedChange(checked: boolean) => void変更コールバック
disabledboolean無効化

使用例

import { SwitchField } from "@unitto/ui";

<SwitchField
  label="通知を受け取る"
  description="メールで通知を受け取ります"
  onCheckedChange={(checked) => console.log(checked)}
/>

On this page