Skip to main content
Mantı UI logoMantı UIv0.13.0
Studio

Checkbox

Use defaultChecked for uncontrolled state or checked with onCheckedChange for controlled state. indeterminate shows a mixed value.

import { Checkbox } from '@manti-ui/react';

export default function CheckboxBasic() {
  return (
    <div className="grid gap-3">
      <Checkbox defaultChecked={false}>Unchecked</Checkbox>
      <Checkbox defaultChecked>Checked</Checkbox>
      <Checkbox indeterminate>Indeterminate</Checkbox>
      <Checkbox defaultChecked={false} disabled>
        Disabled
      </Checkbox>
    </div>
  );
}

Sizes

API

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Control size.
variantMantiVariant'primary'Active variant when checked.
indeterminatebooleanfalseRender the mixed/indeterminate state.
childrenReactNode—Optional trailing label.
checkedboolean—Controlled checked state.
defaultCheckedboolean—Initial checked state for uncontrolled usage.
onCheckedChange(checked: boolean) => void—Called whenever the checked state changes.
disabledboolean—Disable the control.
invalidboolean—Mark the control as invalid.
requiredboolean—Require the control in a form.
readOnlyboolean—Make the control read-only.
namestring—Form field name.
valuestring—Form field value when checked.

Styling

Anatomy

PartSelectorDescription
root[data-scope="checkbox"][data-part="root"]The label wrapping the control and text.
control[data-scope="checkbox"][data-part="control"]The square box that shows the check.
indicator[data-scope="checkbox"][data-part="indicator"]The drawn check or dash inside the box.
label[data-scope="checkbox"][data-part="label"]The trailing text label, when `children` is set.

Tokens

TokenControls
--manti-checkbox-sizesize
--manti-checkbox-radiusradius
--manti-checkbox-gapgap
--manti-checkbox-font-sizefont size
--manti-checkbox-indicator-sizeindicator size

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub