Checkbox Component

The Checkbox component allows users to select one or more options from a list of choices.

Props

PropTypeDefaultDescription
checkedbooleanfalseWhether the checkbox is checked
size"xs" | "sm" | "md" | "lg" | "xl""md"Sets the size of the checkbox
variant"primary" | "secondary" | "success" | "warning" | "error" | "ghost""primary"Sets the color variant of the checkbox
labelstringundefinedLabel text for the checkbox
wrapperClassstring""Additional CSS classes for the wrapper element
sxReact.CSSProperties{}Custom styles to be applied to the checkbox

Usage

import { Checkbox } from 'knoxui-react';

const [isChecked, setIsChecked] = useState(false);

<Checkbox
  checked={isChecked}
  onChange={(e) => setIsChecked(e.target.checked)}
  label="Check me"
/>

Examples

Basic Usage

Sizes

Variants