Checkbox Component
The Checkbox component allows users to select one or more options from a list of choices.
Props
Prop | Type | Default | Description |
---|---|---|---|
checked | boolean | false | Whether 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 |
label | string | undefined | Label text for the checkbox |
wrapperClass | string | "" | Additional CSS classes for the wrapper element |
sx | React.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"
/>