packages/components/eui-autocomplete/eui-autocomplete-option/eui-autocomplete-option.component.ts
Component used internally by eui-autocomplete to display individual options in the dropdown panel.
Represents a single selectable item with support for active, disabled, and grouped states.
Automatically rendered by the parent autocomplete component based on autocompleteData.
Supports visual variants through BaseStatesDirective for custom styling.
Not intended for direct use in templates - managed internally by eui-autocomplete.
This component is used internally by eui-autocomplete. Configure options via the parent component:
Example :<eui-autocomplete [autocompleteData]="items"></eui-autocomplete>items: EuiAutoCompleteItem[] = [
{ id: 1, label: 'Option 1' },
{ id: 2, label: 'Option 2', isDisabled: true },
{ id: 3, label: 'Option 3', variant: 'success' }
];| changeDetection | ChangeDetectionStrategy.OnPush |
| encapsulation | ViewEncapsulation.None |
| HostDirectives |
BaseStatesDirective
Inputs : euiVariant
|
| selector | eui-autocomplete-option |
| template | |
Properties |
Inputs |
HostBindings |
Accessors |
| isActive |
Default value : false, { transform: booleanAttribute }
|
|
Whether the option is active in the panel. |
| isDisabled |
Default value : false, { transform: booleanAttribute }
|
|
Whether the option is disabled in the panel. |
| isGroupItem |
Default value : false, { transform: booleanAttribute }
|
|
Whether the option is displayed inside a group. |
| attr.role |
Type : string
|
Default value : 'option'
|
|
ARIA role for the host element to ensure proper accessibility. |
| class |
Type : string
|
|
Computes and returns the CSS classes for the component based on its current state. |
| role |
Type : string
|
Default value : 'option'
|
Decorators :
@HostBinding('attr.role')
|
|
ARIA role for the host element to ensure proper accessibility. |
| cssClasses |
getcssClasses()
|
|
Computes and returns the CSS classes for the component based on its current state.
Returns :
string
|