Represents a control that provides a menu of options.
- Element
igc-select
- Slots
-
default— Renders the list of select items. -
prefix— Renders content before the input. -
suffix— Renders content after input. -
header— Renders a container before the list of options. -
footer— Renders a container after the list of options. -
helper-text— Renders content below the input. -
toggle-icon— Renders content inside the suffix container. -
toggle-icon-expanded— Renders content for the toggle icon when the component is in open state. -
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
list— The list wrapping container for the items of the igc-select.input— The encapsulated igc-input of the igc-select.label— The encapsulated text label of the igc-select.prefix— The prefix wrapper of the input of the igc-select.suffix— The suffix wrapper of the input of the igc-select.toggle-icon— The toggle icon wrapper of the igc-select.helper-text— The helper text wrapper of the igc-select.
Properties
Section titled "Properties"autofocus
Section titled "autofocus"The autofocus attribute of the control.
autofocus: boolean Defined in src/components/select/select.ts:218
disabled
Section titled "disabled"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcBaseComboBoxLikeComponent> >(IgcBaseComboBoxLikeComponent) )
The disabled state of the component.
disabled: boolean Defined in src/components/common/mixins/forms/types.ts:29
distance
Section titled "distance"The distance of the select dropdown from its input.
distance: number = 0 Defined in src/components/select/select.ts:225
invalid
Section titled "invalid"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcBaseComboBoxLikeComponent> >(IgcBaseComboBoxLikeComponent) )
Sets the control into invalid state (visual state only).
invalid: boolean Defined in src/components/common/mixins/forms/types.ts:36
keepOpenOnOutsideClick
Section titled "keepOpenOnOutsideClick"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcBaseComboBoxLikeComponent> >(IgcBaseComboBoxLikeComponent) )
Whether the component dropdown should be kept open on clicking outside of it.
keepOpenOnOutsideClick: boolean = false Defined in src/components/common/mixins/combo-box.ts:42
keepOpenOnSelect
Section titled "keepOpenOnSelect"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcBaseComboBoxLikeComponent> >(IgcBaseComboBoxLikeComponent) )
Whether the component dropdown should be kept open on selection.
keepOpenOnSelect: boolean = false Defined in src/components/common/mixins/combo-box.ts:31
label
Section titled "label"The label attribute of the control.
label: string Defined in src/components/select/select.ts:232
Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcBaseComboBoxLikeComponent> >(IgcBaseComboBoxLikeComponent) )
The name attribute of the control.
name: string Defined in src/components/common/mixins/forms/types.ts:42
Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcBaseComboBoxLikeComponent> >(IgcBaseComboBoxLikeComponent) )
Sets the open state of the component.
open: boolean = false Defined in src/components/common/mixins/combo-box.ts:49
outlined
Section titled "outlined"The outlined attribute of the control.
outlined: boolean = false Defined in src/components/select/select.ts:211
placeholder
Section titled "placeholder"The placeholder attribute of the control.
placeholder: string Defined in src/components/select/select.ts:239
placement
Section titled "placement"The preferred placement of the select dropdown around its input.
placement: PopoverPlacement = 'bottom-start' Defined in src/components/select/select.ts:245
scrollStrategy
Section titled "scrollStrategy"Determines the behavior of the component during scrolling of the parent container.
scrollStrategy: PopoverScrollStrategy = 'scroll' Defined in src/components/select/select.ts:252
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-select" = 'igc-select' Defined in src/components/select/select.ts:125
Accessors
Section titled "Accessors"Returns the HTMLFormElement associated with this element.
get form(): HTMLFormElement | null Defined in src/components/common/mixins/forms/types.ts:45
Returns HTMLFormElement | null
groups
Section titled "groups"Returns the groups of the igc-select component.
get groups(): IgcSelectGroupComponent[] Defined in src/components/select/select.ts:262
Returns IgcSelectGroupComponent[]
items
Section titled "items"Returns the items of the igc-select component.
get items(): IgcSelectItemComponent[] Defined in src/components/select/select.ts:255
Returns IgcSelectItemComponent[]
selectedItem
Section titled "selectedItem"Returns the selected item from the dropdown or null.
get selectedItem(): IgcSelectItemComponent | null Defined in src/components/select/select.ts:269
Returns IgcSelectItemComponent | null
validationMessage
Section titled "validationMessage"A string containing the validation message of this element.
get validationMessage(): string Defined in src/components/common/mixins/forms/types.ts:54
Returns string
validity
Section titled "validity"Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.
get validity(): ValidityState Defined in src/components/common/mixins/forms/types.ts:51
Returns ValidityState
willValidate
Section titled "willValidate"A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.
get willValidate(): boolean Defined in src/components/common/mixins/forms/types.ts:60
Returns boolean
Methods
Section titled "Methods"Removes focus from the component.
blur(): void Defined in src/components/select/select.ts:564
Returns void
checkValidity
Section titled "checkValidity"Checks for validity of the control and emits the invalid event if it invalid.
checkValidity(): boolean Defined in src/components/common/mixins/forms/types.ts:140
Returns boolean
clearSelection
Section titled "clearSelection"Resets the current value and selection of the component.
clearSelection(): void Defined in src/components/select/select.ts:607
Returns void
focus
Section titled "focus"Sets focus on the component.
focus(options: FocusOptions): void Defined in src/components/select/select.ts:558
Parameters
- options:
FocusOptions
Returns void
Hides the component.
hide(): Promise<boolean> Defined in src/components/common/mixins/combo-box.ts:107
Returns Promise<boolean>
navigateTo
Section titled "navigateTo"Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null.
navigateTo(value: string): IgcSelectItemComponent | null Defined in src/components/select/select.ts:577
Parameters
- value:
string
Returns IgcSelectItemComponent | null
reportValidity
Section titled "reportValidity"Checks the validity of the control and moves the focus to it if it is not valid.
reportValidity(): boolean Defined in src/components/select/select.ts:569
Returns boolean
select
Section titled "select"Selects the item with the specified value. If it exists, returns the found item, otherwise - null.
select(value: string): IgcSelectItemComponent | null Defined in src/components/select/select.ts:595
Parameters
- value:
string
Returns IgcSelectItemComponent | null
setCustomValidity
Section titled "setCustomValidity"Sets a custom validation message for the control.
As long as message is not empty, the control is considered invalid.
setCustomValidity(message: string): void Defined in src/components/common/mixins/forms/types.ts:149
Parameters
- message:
string
Returns void
Shows the component.
show(): Promise<boolean> Defined in src/components/common/mixins/combo-box.ts:102
Returns Promise<boolean>
toggle
Section titled "toggle"Toggles the open state of the component.
toggle(): Promise<boolean> Defined in src/components/common/mixins/combo-box.ts:112