Skip to content

Checkbox

The Checkbox component is a simple checkbox input. It can be used on its own or inside the FormWrapper component if you have multiple inputs.

See all the examples and details in the Storybook.

Usage

tsx
import { Checkbox } from "@samgl/graffiti-ui";

const MyCheckbox = () => {
  return (
    <Checkbox
      label="The quick brown fox jumps over the lazy dog"
      onClick={() => alert("Clicked!")}
    />
  );
};

Props

PropTypeDefaultOptionalDescription
labelstringThe label to display next to the checkbox.
classNamestringThe class name of the component, generally used when extending the component with a styled component.

All other props will also be passed to the underlying input element.