Checkbox

選択状態を切り替えるチェックボックスコンポーネント。

Installation

npx shadcn@latest add https://kasumi-ui.vercel.app/r/checkbox.json

Usage

import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";

<Checkbox id="checkbox-basic" />
<Label htmlFor="checkbox-basic">利用規約に同意する</Label>

Size

<Checkbox size="sm" />
<Checkbox size="md" />
<Checkbox size="lg" />

Invalid

<Checkbox error />

Disabled

<Checkbox disabled />

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"チェックボックスのサイズ
errorbooleanfalseエラー状態を表示する
disabledbooleanfalse無効状態にする