Label
フォーム要素のラベルコンポーネント。
インポート
import { Label } from '@caroainc/ui-components'個別サブパス(バンドルサイズを抑えたい場合):
import { Label } from '@caroainc/ui-components/label'基本的な使い方
Loading...
<Label htmlFor="email">メールアドレス</Label>
<Input id="email" type="email" />Checkboxと組み合わせ
Loading...
<div className="flex items-center gap-2">
<Checkbox id="terms" />
<Label htmlFor="terms">利用規約に同意する</Label>
</div>必須マーク付き
Loading...
<Label htmlFor="required">
名前 <span className="text-destructive">*</span>
</Label>Props
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | - | 関連付けるフォーム要素のID |