Leave Yamada UI a star

Star
Yamada UIYamada UIv1.7.2

Checkbox

Checkbox is a component used for allowing users to select multiple values from multiple options.

Source@yamada-ui/checkbox

Props

CheckboxProps

checked

Description

If true, the checkbox will be checked.

Type

boolean

Default

false

colorScheme

Description

The visual color appearance of the component.

Type

"blackAlpha" | "whiteAlpha" | "amber" | "blue" | "info" | "link" | "primary" | "cyan" | "emerald" | "flashy" | "fuchsia" | "gray" | "green" | "success" | "indigo" | "lime" | "neutral" | "orange" | "warning" | "pink" | "purple" | "red" | "danger" | "rose" | "sky" | "teal" | "violet" | "secondary" | "yellow"

Default

"primary"

defaultChecked

Description

If true, the checkbox will be initially checked.

Type

boolean

Default

false

defaultIsChecked

Deprecated

Description

If true, the checkbox will be initially checked.

Deprecated

Use defaultChecked instead.

Type

boolean

Default

false

disabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

iconProps

Description

Props for icon component.

Type

{ children: ReactElement<any, string | JSXElementConstructor<any>> } & Omit<HTMLUIProps, "children">

id

Description

id assigned to input.

Type

string

indeterminate

Description

If true, the checkbox will be indeterminate.

Type

boolean

Default

false

inputProps

Description

Props for input element.

Type

InputHTMLAttributes<HTMLInputElement>

invalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isChecked

Deprecated

Description

If true, the checkbox will be checked.

Deprecated

Use checked instead.

Type

boolean

Default

false

isDisabled

Deprecated

Description

If true, the form control will be disabled.

Deprecated

Use disabled instead.

Type

boolean

Default

false

isIndeterminate

Deprecated

Description

If true, the checkbox will be indeterminate.

Deprecated

Use indeterminate instead.

Type

boolean

Default

false

isInvalid

Deprecated

Description

If true, the form control will be invalid.

Deprecated

Use invalid instead.

Type

boolean

Default

false

isReadOnly

Deprecated

Description

If true, the form control will be readonly.

Deprecated

Use readOnly instead.

Type

boolean

Default

false

isRequired

Deprecated

Description

If true, the form control will be required.

Deprecated

Use required instead.

Type

boolean

Default

false

label

Description

The label of the checkbox.

Type

type ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal

labelProps

Description

Props for label element.

Type

HTMLUIProps<"span">

name

Description

The HTML name attribute used for forms.

Type

string

onBlur

Description

The callback invoked when the checkbox is blurred.

Type

FocusEventHandler<HTMLInputElement>

onChange

Description

The callback invoked when the checked state changes.

Type

ChangeEventHandler<HTMLInputElement>

onFocus

Description

The callback invoked when the checkbox is focused.

Type

FocusEventHandler<HTMLInputElement>

readOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

required

Description

If true, the form control will be required.

Type

boolean

Default

false

selectOnEnter

Description

If true, the checkbox will be selected when the Enter key is pressed.

Type

boolean

Default

false

size

Description

The size of the Checkbox.

Type

"sm" | "md" | "lg"

Default

"md"

tabIndex

Description

The tab-index property of the underlying input element.

Type

number

value

Description

The value to be used in the checkbox input.

Type

Y

variant

Description

The variant of the Checkbox.

Type

string

CheckboxGroupProps

align

Description

The CSS align-items property.

Type

UIValue<AlignItems>

basis

Description

The CSS flex-basis property.

Type

UIValue<number | "content" | "px" | "initial" | "inherit" | (string & {}) | "auto" | "max" | "min" | "1" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "2xl" | "lg" | "md" | "sm" | ... 68 more ... | "xs">

defaultValue

Description

The initial value of the checkbox group.

Type

Y[]

direction

Description

The CSS flex-direction property.

Type

UIValue<FlexDirection>

disabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

grow

Description

The CSS flex-grow property.

Type

UIValue<FlexGrow>

invalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isDisabled

Deprecated

Description

If true, the form control will be disabled.

Deprecated

Use disabled instead.

Type

boolean

Default

false

isInvalid

Deprecated

Description

If true, the form control will be invalid.

Deprecated

Use invalid instead.

Type

boolean

Default

false

isNative

Deprecated

Description

If true, input elements will receive checked attribute instead of isChecked. This assumes, you're using native radio inputs.

Deprecated

It will be deprecated in version 2.0.

Type

boolean

Default

false

isReadOnly

Deprecated

Description

If true, the form control will be readonly.

Deprecated

Use readOnly instead.

Type

boolean

Default

false

isRequired

Deprecated

Description

If true, the form control will be required.

Deprecated

Use required instead.

Type

boolean

Default

false

items

Description

If provided, generate checkboxes based on items.

Type

CheckboxItem<Y>[]

Default

'[]'

justify

Description

The CSS justify-content property.

Type

UIValue<JustifyContent>

onChange

Description

The callback fired when any children checkbox is checked or unchecked.

Type

(value: Y[]) => void

readOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

required

Description

If true, the form control will be required.

Type

boolean

Default

false

shrink

Description

The CSS flex-shrink property.

Type

UIValue<FlexShrink>

value

Description

The value of the checkbox group.

Type

Y[]

wrap

Description

The CSS flex-wrap property.

Type

UIValue<FlexWrap>

CheckboxIconProps

as

Description

The HTML element to render.

Type

keyof ReactDOM

checked

Description

If true, the icon will be checked.

Type

boolean

Default

false

disabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

indeterminate

Description

If true, the icon will be indeterminate.

Type

boolean

Default

false

invalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isChecked

Deprecated

Description

If true, the icon will be checked.

Deprecated

Use checked instead.

Type

boolean

Default

false

isDisabled

Deprecated

Description

If true, the form control will be disabled.

Deprecated

Use disabled instead.

Type

boolean

Default

false

isIndeterminate

Deprecated

Description

If true, the icon will be indeterminate.

Deprecated

Use indeterminate instead.

Type

boolean

Default

false

isInvalid

Deprecated

Description

If true, the form control will be invalid.

Deprecated

Use invalid instead.

Type

boolean

Default

false

isReadOnly

Deprecated

Description

If true, the form control will be readonly.

Deprecated

Use readOnly instead.

Type

boolean

Default

false

isRequired

Deprecated

Description

If true, the form control will be required.

Deprecated

Use required instead.

Type

boolean

Default

false

readOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

required

Description

If true, the form control will be required.

Type

boolean

Default

false

UseCheckboxProps

checked

Description

If true, the checkbox will be checked.

Type

boolean

Default

false

defaultChecked

Description

If true, the checkbox will be initially checked.

Type

boolean

Default

false

defaultIsChecked

Deprecated

Description

If true, the checkbox will be initially checked.

Deprecated

Use defaultChecked instead.

Type

boolean

Default

false

disabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

id

Description

id assigned to input.

Type

string

indeterminate

Description

If true, the checkbox will be indeterminate.

Type

boolean

Default

false

invalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isChecked

Deprecated

Description

If true, the checkbox will be checked.

Deprecated

Use checked instead.

Type

boolean

Default

false

isDisabled

Deprecated

Description

If true, the form control will be disabled.

Deprecated

Use disabled instead.

Type

boolean

Default

false

isIndeterminate

Deprecated

Description

If true, the checkbox will be indeterminate.

Deprecated

Use indeterminate instead.

Type

boolean

Default

false

isInvalid

Deprecated

Description

If true, the form control will be invalid.

Deprecated

Use invalid instead.

Type

boolean

Default

false

isReadOnly

Deprecated

Description

If true, the form control will be readonly.

Deprecated

Use readOnly instead.

Type

boolean

Default

false

isRequired

Deprecated

Description

If true, the form control will be required.

Deprecated

Use required instead.

Type

boolean

Default

false

name

Description

The HTML name attribute used for forms.

Type

string

onBlur

Description

The callback invoked when the checkbox is blurred.

Type

FocusEventHandler<HTMLInputElement>

onChange

Description

The callback invoked when the checked state changes.

Type

ChangeEventHandler<HTMLInputElement>

onFocus

Description

The callback invoked when the checkbox is focused.

Type

FocusEventHandler<HTMLInputElement>

readOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

required

Description

If true, the form control will be required.

Type

boolean

Default

false

selectOnEnter

Description

If true, the checkbox will be selected when the Enter key is pressed.

Type

boolean

Default

false

tabIndex

Description

The tab-index property of the underlying input element.

Type

number

value

Description

The value to be used in the checkbox input.

Type

Y

UseCheckboxGroupProps

defaultValue

Description

The initial value of the checkbox group.

Type

Y[]

isNative

Deprecated

Description

If true, input elements will receive checked attribute instead of isChecked. This assumes, you're using native radio inputs.

Deprecated

It will be deprecated in version 2.0.

Type

boolean

Default

false

onChange

Description

The callback fired when any children checkbox is checked or unchecked.

Type

(value: Y[]) => void

value

Description

The value of the checkbox group.

Type

Y[]

Edit this page on GitHub

PreviousRadioCardNextCheckboxCard