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 select. -
input— The encapsulated input of the select. -
label— The encapsulated text label of the select. -
prefix— The prefix wrapper of the input of the select. -
suffix— The suffix wrapper of the input of the select. -
toggle-icon— The toggle icon wrapper of the select. -
helper-text— The helper text wrapper of the select.
Properties
Section titled "Properties"autofocus
Section titled "autofocus"Whether the control should receive focus automatically.
autofocus: boolean Defined in src/components/select/select.ts:239
disabled
Section titled "disabled"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
The disabled state of the component.
disabled: boolean Defined in src/internals/mixins/forms/types.ts:30
distance
Section titled "distance"The distance of the select dropdown from its input.
distance: number = 0 Defined in src/components/select/select.ts:246
invalid
Section titled "invalid"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Sets the control into invalid state (visual state only).
invalid: boolean Defined in src/internals/mixins/forms/types.ts:37
keepOpenOnOutsideClick
Section titled "keepOpenOnOutsideClick"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Whether the component dropdown should be kept open on clicking outside of it.
keepOpenOnOutsideClick: boolean = false Defined in src/internals/mixins/combo-box.ts:84
keepOpenOnSelect
Section titled "keepOpenOnSelect"Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Whether the component dropdown should be kept open on selection.
keepOpenOnSelect: boolean = false Defined in src/internals/mixins/combo-box.ts:72
label
Section titled "label"The label of the control.
label: string Defined in src/components/select/select.ts:253
Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
The name of the control, submitted with the form data.
name: string Defined in src/internals/mixins/forms/types.ts:43
Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcSelectComponentEventMap, AbstractConstructor<IgcComboBoxBaseLikeComponent> >(IgcComboBoxBaseLikeComponent) )
Sets the open state of the component.
open: boolean = false Defined in src/internals/mixins/combo-box.ts:33
outlined
Section titled "outlined"Whether the control has an outlined appearance.
outlined: boolean = false Defined in src/components/select/select.ts:232
placeholder
Section titled "placeholder"The placeholder text of the control.
placeholder: string Defined in src/components/select/select.ts:260
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:266
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:273
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:135
Accessors
Section titled "Accessors"defaultValue
Section titled "defaultValue"get defaultValue(): any Defined in src/internals/mixins/forms/types.ts:182
The initial value of the component.
set defaultValue(value: unknown): void Defined in src/internals/mixins/forms/types.ts:182
Parameters
- value:
unknown
Returns void
Returns the HTMLFormElement associated with this element.
get form(): HTMLFormElement | null Defined in src/internals/mixins/forms/types.ts:46
Returns HTMLFormElement | null
groups
Section titled "groups"Returns the groups of the select component.
get groups(): IgcSelectGroupComponent[] Defined in src/components/select/select.ts:283
Returns IgcSelectGroupComponent[]
items
Section titled "items"Returns the items of the select component.
get items(): IgcSelectItemComponent[] Defined in src/components/select/select.ts:276
Returns IgcSelectItemComponent[]
required
Section titled "required"get required(): any Defined in src/internals/mixins/forms/types.ts:207
When set, makes the component a required field for validation.
set required(value: boolean): void Defined in src/internals/mixins/forms/types.ts:207
Parameters
- value:
boolean
Returns void
selectedItem
Section titled "selectedItem"Returns the selected item from the dropdown or null.
get selectedItem(): IgcSelectItemComponent | null Defined in src/components/select/select.ts:290
Returns IgcSelectItemComponent | null
validationMessage
Section titled "validationMessage"A string containing the validation message of this element.
get validationMessage(): string Defined in src/internals/mixins/forms/types.ts:55
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/internals/mixins/forms/types.ts:52
Returns ValidityState
value
Section titled "value"get value(): any Defined in src/components/select/select.ts:217
The value of the control.
set value(value: string | undefined): void Defined in src/components/select/select.ts:217
Parameters
- value:
string | undefined
Returns void
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/internals/mixins/forms/types.ts:61
Returns boolean
Methods
Section titled "Methods"Removes focus from the component.
blur(): void Defined in src/components/select/select.ts:685
Returns void
checkValidity
Section titled "checkValidity"Checks for validity of the control and emits the invalid event if it's invalid.
checkValidity(): boolean Defined in src/internals/mixins/forms/types.ts:166
Returns boolean
clearSelection
Section titled "clearSelection"Resets the current value and selection of the component.
clearSelection(): void Defined in src/components/select/select.ts:728
Returns void
focus
Section titled "focus"Sets focus on the component.
focus(options: FocusOptions): void Defined in src/components/select/select.ts:679
Parameters
- options:
FocusOptions
Returns void
Hides the component.
hide(): Promise<boolean> Defined in src/internals/mixins/combo-box.ts:53
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:698
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:690
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:716
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/internals/mixins/forms/types.ts:175
Parameters
- message:
string
Returns void
Shows the component.
show(): Promise<boolean> Defined in src/internals/mixins/combo-box.ts:48
Returns Promise<boolean>
toggle
Section titled "toggle"Toggles the open state of the component.
toggle(): Promise<boolean> Defined in src/internals/mixins/combo-box.ts:58