Superui logo

SuperUI

alpha

DocsCommunityMy components
DocsCommunityMy components

Checkbox

Reusable checkbox React component.

import { Checkbox } from "@superui/styles";
// You should import the CSS file to use the component
import "@superui/styles/dist/styles/main.css";

Basic usage

import { Checkbox } from "@superui/styles";
import "@superui/styles/dist/styles/main.css";

<Checkbox variant="primary" id="sample-checkbox">
  Sample checkbox
</Checkbox>;

Props

NameTypeDefaultDescription
variantstringprimaryThe variant of the checkbox.
checkedbooleanfalseWhether the checkbox is checked.
onChangefunction-The function to call when the checkbox is changed.
idstring-The id of the checkbox. (Mandatory if more checkboxes in the component.)
namestring-The name of the checkbox.
labelstring-The label of the checkbox.
disabledbooleanfalseWhether the checkbox is disabled.
classNamestring-The class name of the checkbox.