Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.1

Checkbox

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

Source@yamada-ui/checkbox

Props

CheckboxProps

colorScheme

Description

The visual color appearance of the component.

Type

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

Default

primary

defaultIsChecked

Description

If true, the checkbox will be initially checked.

Type

boolean

Default

false

iconProps

Description

Props for icon component.

Type

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

id

Description

id assigned to input.

Type

string

inputProps

Description

Props for input element.

Type

InputHTMLAttributes<HTMLInputElement>

isChecked

Description

If true, the checkbox will be checked.

Type

boolean

Default

false

isDisabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

isIndeterminate

Description

If true, the checkbox will be indeterminate.

Type

boolean

Default

false

isInvalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isReadOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

isRequired

Description

If true, the form control will be required.

Type

boolean

Default

false

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>

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

CheckboxIconProps

isChecked

Description

If true, the icon will be checked.

Type

boolean

Default

false

isDisabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

isIndeterminate

Description

If true, the icon will be indeterminate.

Type

boolean

Default

false

isInvalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isReadOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

isRequired

Description

If true, the form control will be required.

Type

boolean

Default

false

UseCheckboxProps

defaultIsChecked

Description

If true, the checkbox will be initially checked.

Type

boolean

Default

false

id

Description

id assigned to input.

Type

string

isChecked

Description

If true, the checkbox will be checked.

Type

boolean

Default

false

isDisabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

isIndeterminate

Description

If true, the checkbox will be indeterminate.

Type

boolean

Default

false

isInvalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isReadOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

isRequired

Description

If true, the form control will be required.

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>

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

CheckboxGroupProps

align

Description

The CSS align-items property.

Type

(string & {}) | "center" | "end" | "initial" | "inherit" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "normal" | "start" | "baseline" | "stretch" | "flex-end" | "flex-start" | ... 6 more ... | ((theme: StyledTheme) => UIValue<...>)

basis

Description

The CSS flex-basis property.

Type

number | (string & {}) | "content" | "px" | "max" | "min" | "initial" | "inherit" | "auto" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "sm" | "md" | "lg" | "xl" | "2xl" | ... 72 more ... | ((theme: StyledTheme) => UIValue<...>)

direction

Description

The CSS flex-direction property.

Type

"initial" | "inherit" | "row" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "column" | "column-reverse" | "row-reverse" | Partial<Record<(string & {}) | "base" | "sm" | "md" | "lg" | "xl" | "2xl", FlexDirection>> | ColorModeArray<...> | Partial<...> | ColorModeArray<...> | ((theme: StyledTheme) => UIValue...

grow

Description

The CSS flex-grow property.

Type

(string & {}) | "initial" | "inherit" | "-moz-initial" | "revert" | "revert-layer" | "unset" | (number & {}) | Partial<Record<(string & {}) | "base" | "sm" | "md" | "lg" | "xl" | "2xl", FlexGrow>> | ColorModeArray<...> | Partial<...> | ColorModeArray<...> | ((theme: StyledTheme) => UIValue<...>)

isDisabled

Description

If true, the form control will be disabled.

Type

boolean

Default

false

isInvalid

Description

If true, the form control will be invalid.

Type

boolean

Default

false

isNative

Description

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

Type

boolean

Default

false

isReadOnly

Description

If true, the form control will be readonly.

Type

boolean

Default

false

isRequired

Description

If true, the form control will be required.

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

(string & {}) | "left" | "right" | "center" | "end" | "initial" | "inherit" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "normal" | "start" | "space-around" | "space-between" | ... 8 more ... | ((theme: StyledTheme) => UIValue<...>)

onChange

Description

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

Type

(value: Y[]) => void

shrink

Description

The CSS flex-shrink property.

Type

(string & {}) | "initial" | "inherit" | "-moz-initial" | "revert" | "revert-layer" | "unset" | (number & {}) | Partial<Record<(string & {}) | "base" | "sm" | "md" | "lg" | "xl" | "2xl", FlexShrink>> | ColorModeArray<...> | Partial<...> | ColorModeArray<...> | ((theme: StyledTheme) => UIValue<...>)

value

Description

The value of the checkbox group.

Type

Y[]

wrap

Description

The CSS flex-wrap property.

Type

"initial" | "inherit" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "wrap" | "nowrap" | "wrap-reverse" | Partial<Record<(string & {}) | "base" | "sm" | "md" | "lg" | "xl" | "2xl", FlexWrap>> | ColorModeArray<...> | Partial<...> | ColorModeArray<...> | ((theme: StyledTheme) => UIValue<...>)

UseCheckboxGroupProps

defaultValue

Description

The initial value of the checkbox group.

Type

Y[]

isNative

Description

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

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

PreviousRadioNextSwitch