JGuang

Radio

Radio · Arco Design

Preview
npm install @arco-design/web-react@2.66.18

Radio

In a set of related and mutually exclusive data, the user can only select one option.

Install

npm install @arco-design/web-react@2.66.18

Import @arco-design/web-react/dist/css/arco.css at the entry and set the locale with ConfigProvider. React 19 projects must also import @arco-design/web-react/es/_util/react-19-adapter first, or imperative APIs such as Message and Modal cannot render.

Examples

  • Basic: Basic usage.
  • Radio Group: A group of radio components. It can be generated by children or a options array.
  • Vertical Radio.Group: If direction is 'vertical', the vertical Radio.Group will be displayed.
  • Radio with icon: You can display icons in children.
  • Button style: The combination of radio button style.
  • Size: The radio group of button type has four sizes available: mini, small, default, large.
  • Custom Render Radio: Render radio nodes can be customized by passing a function of type 'children'.(2.29.0)

Examples come from the official Arco Design repository (MIT) at the commit published as npm 2.66.18. Some use online images or upload endpoints; network requests are disabled in previews.

API

Radio

PropertyDescriptionTypeDefaultValue
checkedWhether the radio is checked (Controlled)boolean-
defaultCheckedWhether the radio is initially selectedboolean-
disabledWhether the radio is disabledboolean-
classNameAdditional css classstring | string[]-
styleAdditional styleCSSProperties-
valueThe value of radioT-
onChangeCallback when radio status change(checked: boolean, event: ChangeEvent) => void-

Radio.Group

PropertyDescriptionTypeDefaultValue
disableddisabledboolean-
nameRadio's name attrstring-
directionArrangement direction'vertical' | 'horizontal'horizontal
sizeThe size of radio button style(Only effective under button type)'small' | 'default' | 'large' | 'mini'-
typetype of Radio'radio' | 'button'radio
classNameAdditional css classstring | string[]-
defaultValueTo set default valueany-
optionsSet children options(string | number | { label: ReactNode; value: any; disabled?: boolean })[]-
styleAdditional styleCSSProperties-
valueTo set valueany-
onChangeCallback when radio status change(value: any, event: ChangeEvent) => void-