Radio

Radios allow the user to select a single option from a group.

Radios allow the user to select a single option from a group. Radios are designed to be used with radio groups .

Option 1 Option 2 Option 3

To set the initial value and checked state, use the value attribute on the containing radio group.

Option 1 Option 2 Option 3

Use the disabled attribute to disable a radio.

Option 1 Option 2 Option 3
import '@ods/components/web.radio';

Note: You only need to import a web component once in your code, as it registers itself globally when defined, allowing you to use it anywhere within your application without needing to re-import it each time you want to use the component.

Slots

NameDescription
(default)The radio's label.

Properties

Please note, both DOM properties and HTML attributes are shown in the table below. Unless otherwise specified, the property and attribute names are identical.

Property/AttributeReflectsTypeDefault
checked
booleanfalse
value
string
size
'small' | 'medium' | 'large''medium'
disabled
booleanfalse

Events

React EventDescriptionEvent Detail
ods-blurEmitted when the control loses focus.--
ods-focusEmitted when the control gains focus.--

Parts

NameDescription
baseThe component's base wrapper.
controlThe circular container that wraps the radio's checked state.
control--checkedThe radio control when the radio is checked.
checked-iconThe checked icon, an `<ods-icon>` element.
labelThe container that wraps the radio's label.

Dependencies

This component automatically imports the following dependencies.

  • ods-icon

See Radio Group for more details

Search