Lets the user select one option from a set. Radios with the same name
form a group, and only one radio of the group is checked.
- Slots
-
default— The radio label. -
helper-text— Renders content below the input. -
value-missing— Renders content when the required validation fails. -
custom-error— Renders content when setCustomValidity(message) is set. -
invalid— Renders content when the component is in invalid state (validity.valid = false).
- CSS Parts
-
base— The radio control base wrapper. -
control— The circle of the radio. -
label— The radio control label. -
ripple— The highlight around the circle on hover and focus. A disabled radio hides it. -
checked— Added to the base, control, label and ripple parts when the radio is checked. -
focused— Added to the base part when the radio has keyboard focus.
Properties
Section titled "Properties"checked
Section titled "checked"Whether the control is checked. A checked radio clears the other radios of its group.
checked: boolean labelPosition
Section titled "labelPosition"The label position of the radio control.
labelPosition: ToggleLabelPosition required
Section titled "required"Whether the group of the radio is required. A required group fails validation while none of its radios is checked.
required: boolean value
Section titled "value"The value of the control, submitted when the control is checked.
value: string Methods
Section titled "Methods"Removes focus from the radio control.
blur(): void Returns void
checkValidity
Section titled "checkValidity"Checks the validity of the whole group. Each invalid radio of the group
emits invalid.
checkValidity(): boolean Returns boolean
click
Section titled "click"Simulates a click on the radio control.
click(): void Returns void
focus
Section titled "focus"Sets focus on the radio control.
focus(options: FocusOptions): void Parameters
- options:
FocusOptions
Returns void
reportValidity
Section titled "reportValidity"Checks the validity of the group. An invalid radio emits invalid and
takes the focus. It shows its own validation messages, not the message of
the browser.
reportValidity(): boolean Returns boolean
setCustomValidity
Section titled "setCustomValidity"Sets a custom validation message on every radio of the group. The radios
are invalid while message is not empty.
setCustomValidity(message: string): void Parameters
- message:
string
Returns void
Events
Section titled "Events"onChange
Section titled "onChange"Emitted when the checked state of the control changes by user interaction.
onChange(args: CustomEvent<IgrRadioChangeEventArgs>): void