Skip to Content
DocsResourcesShowcase

Checkbox

Used in forms when a user needs to select multiple values from several options

SourceStorybookRecipeArk

import { Checkbox } from '@saas-ui/react/checkbox'
<Checkbox>Click me</Checkbox>

Use the variant prop to change the visual style of the checkbox.

outline

subtle

solid

Use the checked and onCheckedChange props to control the state of the checkbox.

Use the colorPalette prop to change the color of the checkbox.

gray

red

green

blue

teal

pink

purple

cyan

orange

yellow

Use the size prop to change the size of the checkbox.

Use the disabled or invalid prop to change the visual state of the checkbox.

Use the CheckboxGroup component to group multiple checkboxes together.

Select framework

Use the icon prop to change the icon of the checkbox.

Set the checked prop to indeterminate to show the checkbox in an indeterminate state.

Add content to the children of the Checkbox component to add a description.

Render an anchor tag as the checkbox label.

PropDefaultType
value '\'on\''
string

The value of checkbox input. Useful for form submission.

colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent'

The color palette of the component

size 'md'
'sm' | 'md' | 'lg'

The size of the component

variant 'outline'
'outline' | 'subtle'

The variant of the component

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
checked
CheckedState

The checked state of the checkbox

defaultChecked
CheckedState

The checked state of the checkbox when it is first rendered. Use this when you do not need to control the state of the checkbox.

disabled
boolean

Whether the checkbox is disabled

form
string

The id of the form that the checkbox belongs to.

id
string

The unique identifier of the machine.

ids
Partial<{ root: string hiddenInput: string control: string label: string }>

The ids of the elements in the checkbox. Useful for composition.

invalid
boolean

Whether the checkbox is invalid

name
string

The name of the input field in a checkbox. Useful for form submission.

onCheckedChange
(details: CheckedChangeDetails) => void

The callback invoked when the checked state changes.

readOnly
boolean

Whether the checkbox is read-only

required
boolean

Whether the checkbox is required

as
React.ElementType

The underlying element to render.

unstyled
boolean

Whether to remove the component's style.

Previous

Checkbox Card

Next

Clipboard