Skip to content

Forms

Checkbox

Bundle size
6.71 KB
3.0.1

A control that allows the user to toggle between checked and not checked.

This component is an expansion of the Checkbox developed and maintained by Radix UI.

By default, it presents a smooth check animation on toggle.

Terminal window
pnpm add @inpulse-ui/checkbox

Contains all the parts of a checkbox. An input will also render when used within a form to ensure events propagate correctly.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
defaultCheckedbooleanfalseNo
checkedboolean-No
idstring-No
namestring-Yes
disabledboolean-No
requiredboolean-No
monobooleanfalseNo
onChangefunction-No
valuestringonNo
AttributeValue
[data-disabled]Present when disabled
[data-state]

Instantiate the component within a form context and set an appropriate name attribute, otherwise it won’t be rendered. The name attribute must be unique within the form for proper functionality.

import { Checkbox } from '@inpulse-ui/checkbox';
<Form {...useFormProps}>
<Checkbox name="field" />
</Form>

You can set a default value to be selected when the component is rendered. To do this, simply use the defaultChecked property.

You can disable a checkbox by setting the disabled property to true.

By default, Checkbox will be assigned the theme’s primary color when activated. But you can customize this color through CSS classes.

Adopt a monochromatic style for the Checkbox by setting the mono property to true. This style will adapt to the system’s light and dark mode.

Use the onChange event to perform an action every time the value of the Checkbox is changed.

Project

Built with by Jo Santana in Brazil.

© 2026 Inpulse. All rights reserved.