Checkbox

Checkbox component is used in forms when a user needs to select multiple values from several options.

Import#

import { Checkbox, CheckboxGroup } from '@chakra-ui/react'

Usage#

Disabled Checkbox#

Checkbox with custom color#

You can override the color scheme of the Checkbox to any color key specified in theme.colors.

Checkbox sizes#

Pass the size prop to change the size of the Checkbox. Values can be either sm, md or lg.

Invalid Checkbox#

Changing the spacing#

We added the spacing prop to customize the spacing between the Checkbox and label text.

<Checkbox spacing='1rem'>Option</Checkbox>

Changing the icon color and size#

You can customize the color and size of the check icon by passing the iconColor and iconSize prop.

<Checkbox iconColor='blue.400' iconSize='1rem'>
Option
</Checkbox>

Indeterminate#

Icon#

CheckboxGroup#

Chakra exports a CheckboxGroup component to help manage the checked state of its children Checkbox components and conveniently pass a few shared style props to each. See the props table at the bottom of this page for a list of the shared styling props.

Hooks#

The useCheckbox hook is exported with state and focus management logic for use in creating tailor-made checkbox component for your application. Read more about the useCheckbox hook here.

The useCheckboxGroup hook is exported with state management logic for use in creating tailor-made checkbox group component for your application. Read more about the useCheckboxGroup hook here.

Proudly made inNigeria by Segun Adebayo

Deployed by â–² Vercel