Skip to main content

Checkbox

Usage

import Checkbox from "@repo/ui/Checkbox";

<Checkbox />;

Installation

npx the-dig@latest add Checkbox

Props

Use checked/onChange for controlled state or defaultChecked for uncontrolled state. Associate every checkbox with a visible <label>; data-indeterminate does not set the native indeterminate property.

PropTypeDefault
classNamestring-
OthersInputHTMLAttributes<HTMLInputElement> (e.g. onChange, disabled, etc.)Document

Disabled

import Checkbox from "@repo/ui/Checkbox";

<Checkbox defaultChecked disabled />;

Indeterminate

import Checkbox from "@repo/ui/Checkbox";

<Checkbox defaultChecked data-indeterminate />;