Checkbox

Checkbox Orientation

Display checkboxes vertically (stacked) or horizontally (in a row).

<CheckboxGroup
label="Select Fruits"
name="fruits"
options={[
{ value: "apple", label: "Apple" },
{ value: "banana", label: "Banana" },
{ value: "orange", label: "Orange" },
]}
value={selectedValues}
onChange={setSelectedValues}
/>

Checkbox Sizes

Choose from five size options: extra small, small, medium, large, or extra large.

<CheckboxGroup
label="Select Fruits"
name="fruits"
options={[
{ value: "apple", label: "Apple" },
{ value: "banana", label: "Banana" },
{ value: "orange", label: "Orange" },
]}
value={selectedValues}
onChange={setSelectedValues}
/>

Disabled Checkboxes

Disable individual options or the entire checkbox group.

<CheckboxGroup
label="Select Fruits"
name="fruits"
options={[
{ value: "apple", label: "Apple" },
{ value: "banana", label: "Banana" },
{
value: "orange",
label: "Orange",
disabled: true,
},
]}
value={selectedValues}
onChange={setSelectedValues}
/>

Single Checkbox

Use standalone checkboxes for simple boolean choices.

<Checkbox
label="I agree to the terms and conditions"
checked={agreeToTerms}
onChange={setAgreeToTerms}
/>
<Checkbox
label="Subscribe to newsletter"
checked={subscribeNewsletter}
onChange={setSubscribeNewsletter}
/>

Validation

Required Checkbox

Use the required prop with custom error messages for checkboxes that must be checked.

<Checkbox
label="I accept the terms and conditions"
required
errorMessage="You must accept the terms to continue"
/>

API Reference

PropTypeDefaultDescription
labelstringundefinedGroup label displayed above the checkboxes
namestringrequiredName attribute for the checkbox group
optionsCheckboxOption[]requiredArray of checkbox options (value, label, disabled)
valuestring[][]Array of selected checkbox values
onChange(value: string[]) => voidundefinedCallback fired when selection changes
orientation"vertical" | "horizontal""vertical"Layout direction of the checkbox group
requiredbooleanfalseShows asterisk (*) next to label if true
disabledbooleanfalseDisables the entire checkbox group (overrides individual option disabled states)

React UI Components

Interactive Showcase