Components
Checkbox

Checkbox

The Checkbox component is used to create interactive checkboxes that can be used individually or within a CheckboxGroup.

Props

NameTypeDefaultDescription
childrenstring | React.ReactElement | (checked?: boolean) => React.ReactElementThe label or content of the checkbox.
checkedbooleanDetermines whether the checkbox is checked.
onChange(checked: boolean) => voidThe callback function to execute on change.
disabledbooleanfalseDetermines whether the checkbox is disabled.
valueTThe value associated with the checkbox.

Try It

import { useState } from 'react';
import { Checkbox } from '@kloktun/uikit'

export default function CheckboxExample() {
  const [checked, setChecked] = useState(false);

  return (
    <div className="flex flex-col gap-4">

      Checked: {checked ? "true" : "false"}
      
      <Checkbox checked={checked} onChange={setChecked}>
        Label for Checkbox
      </Checkbox>
    </div>
  );
}