Radio

An easily stylable radio button component.

Best apple

API reference

Radio is always placed within Radio Group. Import the components and place them together:

Anatomy
import { Radio } from '@base-ui-components/react/radio';
import { RadioGroup } from '@base-ui-components/react/radio-group';

<RadioGroup>
  <Radio.Root>
    <Radio.Indicator />
  </Radio.Root>
</RadioGroup>
PropTypeDefault
name

string

undefined

defaultValue

any

undefined

value

any

undefined

onValueChange

((value: any, event: Event) => void)

undefined

disabled

boolean

false

readOnly

boolean

false

required

boolean

false

className

string | ((state: State) => string)

undefined

render

| ReactElement
| ((props: GenericHTMLProps, state: State) => ReactElement)

undefined

Attribute
Description
data-disabled

Root

Represents the radio button itself. Renders a <button> element and a hidden <input> beside.

PropTypeDefault
value

any

undefined

disabled

boolean

false

readOnly

boolean

false

required

boolean

false

className

string | ((state: State) => string)

undefined

render

| ReactElement
| ((props: GenericHTMLProps, state: State) => ReactElement)

undefined

Attribute
Description
data-checked
data-unchecked
data-disabled
data-readonly
data-required
data-valid
data-invalid
data-dirty
data-touched
data-filled
data-focused

Indicator

Indicates whether the radio button is selected. Renders a <span> element.

PropTypeDefault
className

string | ((state: State) => string)

undefined

keepMounted

boolean

false

render

| ReactElement
| ((props: GenericHTMLProps, state: State) => ReactElement)

undefined

Attribute
Description
data-checked
data-unchecked
data-disabled
data-readonly
data-required
data-valid
data-invalid
data-dirty
data-touched
data-filled
data-focused