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.
- Element
-
igc-radio
- 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"disabled
Section titled "disabled"Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
Whether the control is disabled. A disabled control is not validated, and the form does not submit its value.
disabled: boolean Defined in src/internals/mixins/forms/types.ts:35
invalid
Section titled "invalid"Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
Whether the control shows the invalid state. It changes only the visual state, not the validity.
invalid: boolean Defined in src/internals/mixins/forms/types.ts:43
labelPosition
Section titled "labelPosition"The label position of the radio control.
labelPosition: ToggleLabelPosition = 'after' Defined in src/components/radio/radio.ts:209
Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
The name of the control, submitted with the form data.
name: string Defined in src/internals/mixins/forms/types.ts:49
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-radio" = 'igc-radio' Defined in src/components/radio/radio.ts:75
Accessors
Section titled "Accessors"checked
Section titled "checked"get checked(): any Defined in src/components/radio/radio.ts:186
Whether the control is checked. A checked radio clears the other radios of its group.
set checked(value: boolean): void Defined in src/components/radio/radio.ts:186
Parameters
- value:
boolean
Returns void
defaultChecked
Section titled "defaultChecked"Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
get defaultChecked(): any Defined in src/internals/mixins/forms/types.ts:175
Whether the control is checked by default. A form reset restores the
checked state to it. While the checked state is unchanged since the start
or the last form reset, a new default also sets the checked state. The
checked attribute also sets it.
set defaultChecked(value: boolean): void Defined in src/internals/mixins/forms/types.ts:175
Parameters
- value:
boolean
Returns void
Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
The form that the control is associated with, or null.
get form(): HTMLFormElement | null Defined in src/internals/mixins/forms/types.ts:52
Returns HTMLFormElement | null
required
Section titled "required"Whether the control is required. A required control that has no value, or is not checked, fails validation.
get required(): boolean Defined in src/components/radio/radio.ts:159
Returns boolean
Whether the group of the radio is required. A required group fails validation while none of its radios is checked.
set required(value: boolean): void Defined in src/components/radio/radio.ts:149
Parameters
- value:
boolean
Returns void
validationMessage
Section titled "validationMessage"Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
The validation message of the control. It is empty when the control is valid.
get validationMessage(): string Defined in src/internals/mixins/forms/types.ts:61
Returns string
validity
Section titled "validity"Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
The validity state of the control.
get validity(): ValidityState Defined in src/internals/mixins/forms/types.ts:55
Returns ValidityState
value
Section titled "value"get value(): any Defined in src/components/radio/radio.ts:168
The value of the control, submitted when the control is checked.
set value(value: string): void Defined in src/components/radio/radio.ts:168
Parameters
- value:
string
Returns void
willValidate
Section titled "willValidate"Inherited from: FormAssociatedCheckboxRequiredMixin( EventEmitterMixin<IgcRadioComponentEventMap>(LitElement) )
Whether the control is a candidate for constraint validation.
get willValidate(): boolean Defined in src/internals/mixins/forms/types.ts:64
Returns boolean
Methods
Section titled "Methods"Removes focus from the radio control.
blur(): void Defined in src/components/radio/radio.ts:297
Returns void
checkValidity
Section titled "checkValidity"Checks the validity of the whole group. Each invalid radio of the group
emits invalid.
checkValidity(): boolean Defined in src/components/radio/radio.ts:310
Returns boolean
click
Section titled "click"Simulates a click on the radio control.
click(): void Defined in src/components/radio/radio.ts:284
Returns void
focus
Section titled "focus"Sets focus on the radio control.
focus(options: FocusOptions): void Defined in src/components/radio/radio.ts:290
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 Defined in src/components/radio/radio.ts:323
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 Defined in src/components/radio/radio.ts:335
Parameters
- message:
string