The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection. In contrast to the Select component, the Combo component displays all options in a virtualized list of items, meaning the combo box can simultaneously show thousands of options, where one or more options can be selected. Additionally, users can create custom item templates, allowing for robust data visualization. The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more.

Element
igc-combo
Slots
prefix — Renders content before the input of the combo.
suffix — Renders content after the input of the combo.
header — Renders a container before the list of options of the combo.
footer — Renders a container after the list of options of the combo.
empty — Renders content when the combo dropdown list has no items/data.
helper-text — Renders content below the input of the combo.
toggle-icon — Renders content inside the suffix container of the combo.
clear-icon — Renders content inside the suffix container of the combo.
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
label — The encapsulated text label of the combo.
input — The main input field of the combo.
native-input — The native input of the main input field of the combo.
prefix — The prefix wrapper of the combo.
suffix — The suffix wrapper of the combo.
toggle-icon — The toggle icon wrapper of the combo.
clear-icon — The clear icon wrapper of the combo.
case-icon — The case icon wrapper of the combo.
helper-text — The helper text wrapper of the combo.
search-input — The search input field of the combo.
list-wrapper — The list of options wrapper of the combo.
list — The list of options box of the combo.
item — Represents each item in the list of options of the combo.
group-header — Represents each header in the list of options of the combo.
active — Appended to the item parts list when the item is active of the combo.
selected — Appended to the item parts list when the item is selected of the combo.
checkbox — Represents each checkbox of each list item of the combo.
checkbox-indicator — Represents the checkbox indicator of each list item of the combo.
checked — Appended to checkbox parts list when checkbox is checked in the combo.
header — The container holding the header content of the combo.
footer — The container holding the footer content of the combo.
empty — The container holding the empty content of the combo.

IgcComboComponent

new IgcComboComponent(): IgcComboComponent

Defined in src/components/combo/combo.ts:563

Returns IgcComboComponent

The autofocus attribute of the control.

autofocus: boolean

Defined in src/components/combo/combo.ts:325

Focuses the list of options when the menu opens.

autofocusList: boolean = false

Defined in src/components/combo/combo.ts:333

Enables the case sensitive search icon in the filtering input.

caseSensitiveIcon: boolean = false

Defined in src/components/combo/combo.ts:461

Hides the clear button.

disableClear: boolean = false

Defined in src/components/combo/combo.ts:484

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

The disabled state of the component.

disabled: boolean

Defined in src/components/common/mixins/forms/types.ts:29

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

emitEvent: object & object

Defined in src/components/common/mixins/event-emitter.ts:30, src/components/common/mixins/combo-box.ts:16

The template used for the content of each combo group header.

groupHeaderTemplate: ComboItemTemplate<T>

Defined in src/components/combo/combo.ts:501

Optional groupKey

Section titled "groupKey"

The key in the data source used to group items in the list.

groupKey: string | keyof T

Defined in src/components/combo/combo.ts:427

Sorts the items in each group by ascending or descending order.

groupSorting: GroupingDirection = 'asc'

Defined in src/components/combo/combo.ts:436

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Sets the control into invalid state (visual state only).

invalid: boolean

Defined in src/components/common/mixins/forms/types.ts:36

The template used for the content of each combo item.

itemTemplate: ComboItemTemplate<T>

Defined in src/components/combo/combo.ts:492

The label attribute of the control.

label: string

Defined in src/components/combo/combo.ts:354

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

The name attribute of the control.

name: string

Defined in src/components/common/mixins/forms/types.ts:42

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Sets the open state of the component.

open: boolean = false

Defined in src/components/common/mixins/combo-box.ts:32

The outlined attribute of the control.

outlined: boolean = false

Defined in src/components/combo/combo.ts:295

Optional placeholder

Section titled "placeholder"

The placeholder attribute of the control.

placeholder: string

Defined in src/components/combo/combo.ts:361

styles: CSSResult[]

Defined in src/components/combo/combo.ts:137

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

tagName: "igc-combo" = 'igc-combo'

Defined in src/components/combo/combo.ts:136

get data(): T[]

Defined in src/components/combo/combo.ts:285

Returns T[]

The data source used to generate the list of options.

set data(value: T[]): void

Defined in src/components/combo/combo.ts:279

Parameters

  • value: T[]

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

get defaultValue(): unknown

Defined in src/components/common/mixins/forms/types.ts:163

Returns unknown

The initial value of the component.

set defaultValue(value: unknown): void

Defined in src/components/common/mixins/forms/types.ts:162

Parameters

  • value: unknown

Returns void

get disableFiltering(): boolean

Defined in src/components/combo/combo.ts:474

Returns boolean

Disables the filtering of the list of options.

set disableFiltering(value: boolean): void

Defined in src/components/combo/combo.ts:469

Parameters

  • value: boolean

Returns void

get displayKey(): keyof T | undefined

Defined in src/components/combo/combo.ts:418

Returns keyof T | undefined

The key in the data source used to display items in the list.

set displayKey(value: keyof T | undefined): void

Defined in src/components/combo/combo.ts:411

Parameters

  • value: keyof T | undefined

Returns void

get filteringOptions(): FilteringOptions<T>

Defined in src/components/combo/combo.ts:451

Returns FilteringOptions<T>

An object that configures the filtering of the combo.

set filteringOptions(value: Partial<FilteringOptions<T>>): void

Defined in src/components/combo/combo.ts:447

Parameters

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Returns the HTMLFormElement associated with this element.

get form(): HTMLFormElement | null

Defined in src/components/common/mixins/forms/types.ts:45

Returns HTMLFormElement | null

get locale(): string

Defined in src/components/combo/combo.ts:345

Returns string

Gets/Sets the locale used for getting language, affecting resource strings.

set locale(value: string): void

Defined in src/components/combo/combo.ts:340

Parameters

  • value: string

Returns void

get placeholderSearch(): string

Defined in src/components/combo/combo.ts:372

Returns string

The placeholder attribute of the search input.

set placeholderSearch(value: string | undefined): void

Defined in src/components/combo/combo.ts:368

Parameters

  • value: string | undefined

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

get required(): boolean

Defined in src/components/common/mixins/forms/types.ts:181

Returns boolean

When set, makes the component a required field for validation.

set required(value: boolean): void

Defined in src/components/common/mixins/forms/types.ts:180

Parameters

  • value: boolean

Returns void

get resourceStrings(): IComboResourceStrings

Defined in src/components/combo/combo.ts:388

Returns IComboResourceStrings

The resource strings for localization.

set resourceStrings(value: IComboResourceStrings): void

Defined in src/components/combo/combo.ts:384

Parameters

  • value: IComboResourceStrings

Returns void

Returns the current selection as an array of objects as provided in the data source.

get selection(): T[]

Defined in src/components/combo/combo.ts:555

Returns T[]

get singleSelect(): boolean

Defined in src/components/combo/combo.ts:316

Returns boolean

Enables single selection mode and moves item filtering to the main input.

set singleSelect(value: boolean): void

Defined in src/components/combo/combo.ts:303

Parameters

  • value: boolean

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

A string containing the validation message of this element.

get validationMessage(): string

Defined in src/components/common/mixins/forms/types.ts:54

Returns string

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

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

Returns the current selection as a list of comma separated values, represented by the value key, when provided.

get value(): ComboValue<T>[]

Defined in src/components/combo/combo.ts:548

Returns ComboValue<T>[]

Sets the value (selected items). The passed value must be a valid JSON array. If the data source is an array of complex objects, the valueKey attribute must be set. Note that when displayKey is not explicitly set, it will fall back to the value of valueKey.

set value(items: ComboValue<T>[]): void

Defined in src/components/combo/combo.ts:535

Example

<igc-combo
 .data=${[
   {
     id: 'BG01',
     name: 'Sofia'
   },
   {
     id: 'BG02',
     name: 'Plovdiv'
   }
 ]}
 display-key='name'
 value-key='id'
 value='["BG01", "BG02"]'>
 </igc-combo>

Parameters

  • items: ComboValue<T>[]

Returns void

get valueKey(): keyof T | undefined

Defined in src/components/combo/combo.ts:402

Returns keyof T | undefined

The key in the data source used when selecting items.

set valueKey(value: keyof T | undefined): void

Defined in src/components/combo/combo.ts:397

Parameters

  • value: keyof T | undefined

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

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

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

addEventListener(type: K, listener: object, options: boolean | AddEventListenerOptions): void

Defined in src/components/common/mixins/event-emitter.ts:7

Parameters

  • type: K
  • listener: object
  • options: boolean | AddEventListenerOptions

Returns void

Removes focus from the component.

blur(): void

Defined in src/components/combo/combo.ts:955

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

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:146

Returns boolean

Deselects option(s) in the list by either reference or valueKey. If not argument is provided all items will be deselected.

deselect(items: Item<T> | Item<T>[]): void

Defined in src/components/combo/combo.ts:1010

Parameters

  • items: Item<T> | Item<T>[]

    One or more items to be deselected. Multiple items should be passed as an array. When valueKey is specified, the corresponding value should be used in place of the item reference.

Returns void

Example

const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');

// Deselect one item at a time by reference when valueKey is not specified.
combo.deselect(combo.data[0]);

// Deselect multiple items at a time by reference when valueKey is not specified.
combo.deselect([combo.data[0], combo.data[1]]);

// Deselect one item at a time when valueKey is specified.
combo.deselect('BG01');

// Deselect multiple items at a time when valueKey is specified.
combo.deselect(['BG01', 'BG02']);

Sets focus on the component.

focus(options: FocusOptions): void

Defined in src/components/combo/combo.ts:949

Parameters

  • options: FocusOptions

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Hides the component.

hide(): Promise<boolean>

Defined in src/components/common/mixins/combo-box.ts:90

Returns Promise<boolean>

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

removeEventListener(type: K, listener: object, options: boolean | EventListenerOptions): void

Defined in src/components/common/mixins/event-emitter.ts:17

Parameters

  • type: K
  • listener: object
  • options: boolean | EventListenerOptions

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Checks for validity of the control and shows the browser message if it invalid.

reportValidity(): boolean

Defined in src/components/common/mixins/forms/types.ts:149

Returns boolean

Selects option(s) in the list by either reference or valueKey. If not argument is provided all items will be selected.

select(items: Item<T> | Item<T>[]): void

Defined in src/components/combo/combo.ts:982

Parameters

  • items: Item<T> | Item<T>[]

    One or more items to be selected. Multiple items should be passed as an array. When valueKey is specified, the corresponding value should be used in place of the item reference.

Returns void

Example

const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');

// Select one item at a time by reference when valueKey is not specified.
combo.select(combo.data[0]);

// Select multiple items at a time by reference when valueKey is not specified.
combo.select([combo.data[0], combo.data[1]]);

// Select one item at a time when valueKey is specified.
combo.select('BG01');

// Select multiple items at a time when valueKey is specified.
combo.select(['BG01', 'BG02']);

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

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:155

Parameters

  • message: string

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Shows the component.

show(): Promise<boolean>

Defined in src/components/common/mixins/combo-box.ts:85

Returns Promise<boolean>

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin< IgcComboComponentEventMap, AbstractConstructor<IgcBaseComboBoxComponent> >(IgcBaseComboBoxComponent) )

Toggles the open state of the component.

toggle(): Promise<boolean>

Defined in src/components/common/mixins/combo-box.ts:95

Returns Promise<boolean>

register(): void

Defined in src/components/combo/combo.ts:140

Returns void

igcChange: CustomEvent<IgcComboChangeEventArgs<any>>

Defined in src/components/combo/types.ts:50

igcClosed: CustomEvent<void>

Defined in src/components/combo/types.ts:59

igcClosing: CustomEvent<void>

Defined in src/components/combo/types.ts:58

igcOpened: CustomEvent<void>

Defined in src/components/combo/types.ts:57

igcOpening: CustomEvent<void>

Defined in src/components/combo/types.ts:56