React

Checkbox

A component that allows users to select one or more options. It is used for selecting multiple items in a list or optional actions like accepting terms.

Available since@seed-design/react@0.0.1, @seed-design/css@0.0.1

Installation

npx @seed-design/cli@latest add ui:checkbox

Props

CheckboxGroup

Prop

Type

label?React.ReactNode
indicator?React.ReactNode
showRequiredIndicator?boolean | undefined
description?React.ReactNode
errorMessage?React.ReactNode

Checkbox

Prop

Type

inputProps?React.InputHTMLAttributes<HTMLInputElement> | undefined
rootRef?React.Ref<HTMLLabelElement> | undefined
label?React.ReactNode
disabled?boolean | undefined
invalid?boolean | undefined
required?boolean | undefined
checked?boolean | undefined
defaultChecked?boolean | undefined
onCheckedChange?((checked: boolean) => void) | undefined
indeterminate?boolean | undefined

Checkmark

Prop

Type

Examples

Sizes

Tones and Variants

Brand

Neutral

Indeterminate

Weights

Deprecated Props

weight="default" and weight="stronger" are no longer supported. Use weight="regular" and weight="bold" instead.

Long Label

Disabled

Listening to Value Changes

You can detect changes in the checkbox selection state using onCheckedChange.

If you need to use events, you can add event handlers directly to the internal <input> element through inputProps.

Use Cases

React Hook Form

Using Checkmark

Checkmark is an independent checkmark component that can be used in combination with the Checkbox Primitive component for custom layouts.

Fieldset Integration

Use CheckboxGroup to group multiple checkboxes and use Fieldset-related props such as label, description, and errorMessage.

Scale Feedback

Checkbox provides feedback where Checkmark slightly shrinks when pressed.

When Scale Feedback is directly applied to the element wrapping Checkmark, both the outer element and Checkmark shrink together, resulting in a double reduction effect. You can disable only Checkmark's shrinking by setting --seed-checkmark-feedback-scale to 1 on the parent element of Checkmark. Since this variable is inherited, you can also set it on the element wrapping the entire Checkbox.

MyRow.css
.my-row {
  --seed-checkmark-feedback-scale: 1;
}

Table of contents