Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.1

Radio

Radio is a component used for allowing users to select one option from multiple choices.

Source@yamada-ui/radio

Props

RadioProps

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 radio will be initially checked.

Type

boolean

Default

false

iconProps

Type

HTMLUIProps<"span">

id

Description

id assigned to input.

Type

string

inputProps

Type

InputHTMLAttributes<HTMLInputElement>

isChecked

Description

If true, the radio will be checked.

Type

boolean

Default

false

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

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

Type

HTMLUIProps<"span">

name

Description

The name of the input field in a radio.

Type

string

onChange

Description

The callback invoked when the checked state changes.

Type

ChangeEventHandler<HTMLInputElement>

size

Description

The size of the Radio.

Type

"sm" | "md" | "lg"

Default

md

value

Description

The value to be used in the radio button.

Type

Y

variant

Description

The variant of the Radio.

Type

string

UseRadioProps

defaultIsChecked

Description

If true, the radio will be initially checked.

Type

boolean

Default

false

id

Description

id assigned to input.

Type

string

isChecked

Description

If true, the radio will be checked.

Type

boolean

Default

false

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

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 name of the input field in a radio.

Type

string

onChange

Description

The callback invoked when the checked state changes.

Type

ChangeEventHandler<HTMLInputElement>

value

Description

The value to be used in the radio button.

Type

Y

RadioGroupProps

align

Description

The CSS align-items property.

Type

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

basis

Description

The CSS flex-basis property.

Type

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

direction

Description

The CSS flex-direction property.

Type

"row" | "inherit" | "-moz-initial" | "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 & {}) | "inherit" | "-moz-initial" | "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 radios based on items.

Type

RadioItem<Y>[]

Default

'[]'

justify

Description

The CSS justify-content property.

Type

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

name

Description

The HTML name attribute used for forms.

Type

string

onChange

Description

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

Type

(value: Y) => void

shrink

Description

The CSS flex-shrink property.

Type

(string & {}) | "inherit" | "-moz-initial" | "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 radio group.

Type

Y

wrap

Description

The CSS flex-wrap property.

Type

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

UseRadioGroupProps

defaultValue

Description

The initial value of the radio group.

Type

Y

id

Description

The top-level id string that will be applied to the radios. The index of the radio will be appended to this top-level id.

Type

string

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

name

Description

The HTML name attribute used for forms.

Type

string

onChange

Description

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

Type

(value: Y) => void

value

Description

The value of the radio group.

Type

Y

Edit this page on GitHub

PreviousTextareaNextCheckbox