packages/eui/packages/components/eui-input-radio/eui-input-radio.component.ts
A radio input component that implements form control functionality and custom styling. This component extends InputDirective and implements form control interfaces for seamless integration with Angular's form controls.
OnInit
DoCheck
OnChanges
ControlValueAccessor
selector | input[euiInputRadio] |
styleUrls | ./eui-input-radio.scss |
Methods |
Inputs |
HostBindings |
HostListeners |
Accessors |
constructor()
|
checked |
Type : any
|
Gets or sets the default checked state of the radio input. This is different from the current checked state and represents the initial value. |
isInvalid |
Type : boolean
|
Gets or sets whether the radio input is in an invalid state. This can be set manually or will be automatically set when used with form validation. |
value |
Type : any
|
Gets or sets the value of the radio input. The value can be of any type and will be used when the radio is selected in a form group. |
disabled |
Type : boolean
|
euiDanger |
Type : boolean
|
Default value : false
|
euiDisabled |
Type : boolean
|
Default value : false
|
placeholder |
Type : string | null
|
readonly |
Type : any
|
attr.type |
Type : string
|
Default value : 'radio'
|
class |
Type : string
|
Gets the CSS classes for the radio input component. Combines base classes with invalid state modifier if applicable. |
keydown.space | ||||||
Arguments : '$event'
|
||||||
keydown.space(event: KeyboardEvent)
|
||||||
Handles space key press events. Prevents selection changes when the input is readonly.
Parameters :
|
registerOnChange | ||||||||
registerOnChange(fn: any)
|
||||||||
Registers a callback function that is called when the control's value changes.
Parameters :
Returns :
void
|
registerOnTouched | ||||||||
registerOnTouched(fn: any)
|
||||||||
Registers a callback function that is called when the control is touched.
Parameters :
Returns :
void
|
Optional setDisabledState | ||||||||
setDisabledState(isDisabled: boolean)
|
||||||||
Sets the disabled state of the radio input.
Parameters :
Returns :
void
|
writeValue | ||||||||
writeValue(obj: string)
|
||||||||
Implements ControlValueAccessor.writeValue. Updates the checked state based on the form control value.
Parameters :
Returns :
void
|
getCssClasses | ||||||
getCssClasses(rootClass: string)
|
||||||
Parameters :
Returns :
string
|
isInvalid | ||||||
getisInvalid()
|
||||||
Gets or sets whether the radio input is in an invalid state. This can be set manually or will be automatically set when used with form validation.
Returns :
boolean
|
||||||
setisInvalid(state: BooleanInput)
|
||||||
Parameters :
Returns :
void
|
class |
getclass()
|
Gets the CSS classes for the radio input component. Combines base classes with invalid state modifier if applicable.
Returns :
string
|
defaultChecked | ||||||
getdefaultChecked()
|
||||||
Gets or sets the default checked state of the radio input. This is different from the current checked state and represents the initial value.
Returns :
any
|
||||||
setdefaultChecked(value: BooleanInput)
|
||||||
Parameters :
Returns :
void
|
selected |
getselected()
|
Gets whether the radio input is currently selected.
Returns :
boolean
|
value | ||||
getvalue()
|
||||
Gets or sets the value of the radio input. The value can be of any type and will be used when the radio is selected in a form group.
Returns :
any
|
||||
setvalue(value)
|
||||
Parameters :
Returns :
void
|