Shows a list of items in a popup next to a target element. The user selects one item from the list.
- Element
-
igc-dropdown
- Slots
-
target— Renders the dropdown's target element. -
default— Renders the dropdown list items. -
header— Renders content before the list items, such as a text field. The content is not part of the list and keeps its own keys. -
footer— Renders content after the list items, such as action buttons. The content is not part of the list and keeps its own keys.
- CSS Parts
-
base— The dropdown list wrapper container. -
list— The dropdown list element.
Properties
Section titled "Properties"distance
Section titled "distance"The distance from the target element.
distance: number = 0 Defined in src/components/dropdown/dropdown.ts:169
Whether the dropdown flips to the opposite side of the target when it does not fit in the visible area. It flips back when its preferred side has enough space again.
flip: boolean = false Defined in src/components/dropdown/dropdown.ts:162
keepOpenOnOutsideClick
Section titled "keepOpenOnOutsideClick"Inherited from: EventEmitterMixin< IgcDropdownComponentEventMap, typeof IgcComboBoxBaseLikeComponent >(IgcComboBoxBaseLikeComponent)
Whether the component stays open when the user clicks outside of it.
keepOpenOnOutsideClick: boolean = false Defined in src/internals/bases/combo-box.ts:170
keepOpenOnSelect
Section titled "keepOpenOnSelect"Inherited from: EventEmitterMixin< IgcDropdownComponentEventMap, typeof IgcComboBoxBaseLikeComponent >(IgcComboBoxBaseLikeComponent)
Whether the component stays open after the user selects an item.
keepOpenOnSelect: boolean = false Defined in src/internals/bases/combo-box.ts:158
Inherited from: EventEmitterMixin< IgcDropdownComponentEventMap, typeof IgcComboBoxBaseLikeComponent >(IgcComboBoxBaseLikeComponent)
Whether the component is open.
open: boolean = false Defined in src/internals/bases/combo-box.ts:50
placement
Section titled "placement"The preferred placement of the component around the target element.
placement: PopoverPlacement = 'bottom-start' Defined in src/components/dropdown/dropdown.ts:154
sameWidth
Section titled "sameWidth"Whether the dropdown has the same width as the target.
sameWidth: boolean = false Defined in src/components/dropdown/dropdown.ts:176
scrollStrategy
Section titled "scrollStrategy"Inherited from: EventEmitterMixin< IgcDropdownComponentEventMap, typeof IgcComboBoxBaseLikeComponent >(IgcComboBoxBaseLikeComponent)
The behavior of the component when a parent container scrolls.
If the value is hide, the component hides while the anchor is fully out
of view. hide is the default value.
If the value is scroll, the component stays visible and anchored.
If the value is close, the component closes on each scroll.
scrollStrategy: PopoverScrollStrategy = 'hide' Defined in src/internals/bases/combo-box.ts:65
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-dropdown" = 'igc-dropdown' Defined in src/components/dropdown/dropdown.ts:92
Accessors
Section titled "Accessors"groups
Section titled "groups"Returns the group items of the dropdown.
get groups(): IgcDropdownGroupComponent[] Defined in src/components/dropdown/dropdown.ts:184
Returns IgcDropdownGroupComponent[]
items
Section titled "items"Returns the items of the dropdown.
get items(): IgcDropdownItemComponent[] Defined in src/components/dropdown/dropdown.ts:179
Returns IgcDropdownItemComponent[]
selectedItem
Section titled "selectedItem"Returns the selected item from the dropdown or null.
get selectedItem(): IgcDropdownItemComponent | null Defined in src/components/dropdown/dropdown.ts:192
Returns IgcDropdownItemComponent | null
Methods
Section titled "Methods"clearSelection
Section titled "clearSelection"Clears the current selection of the dropdown.
clearSelection(): void Defined in src/components/dropdown/dropdown.ts:534
Returns void
connectedCallback
Section titled "connectedCallback"connectedCallback(): void Defined in src/components/dropdown/dropdown.ts:239
Returns void
disconnectedCallback
Section titled "disconnectedCallback"disconnectedCallback(): void Defined in src/components/dropdown/dropdown.ts:247
Returns void
Inherited from: EventEmitterMixin< IgcDropdownComponentEventMap, typeof IgcComboBoxBaseLikeComponent >(IgcComboBoxBaseLikeComponent)
Closes the component. It does not emit events. The promise resolves to
false when the component is already closed, or when a later call
replaces this one.
hide(): Promise<boolean> Defined in src/internals/bases/combo-box.ts:135
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): IgcDropdownItemComponent | null Defined in src/components/dropdown/dropdown.ts:508
Parameters
- value:
string
Returns IgcDropdownItemComponent | null
select
Section titled "select"Selects the item with the specified value. If it exists, returns the found item, otherwise - null.
select(value: string): IgcDropdownItemComponent | null Defined in src/components/dropdown/dropdown.ts:522
Parameters
- value:
string
Returns IgcDropdownItemComponent | null
Opens the dropdown. It does not emit events. The optional target is the
anchor element, or its ID. The promise resolves to false when the
dropdown is already open or has no anchor, or when a later call replaces
this one.
show(target: string | HTMLElement): Promise<boolean> Defined in src/components/dropdown/dropdown.ts:480
Parameters
- target:
string | HTMLElement
Returns Promise<boolean>
toggle
Section titled "toggle"Opens the dropdown when it is closed, and closes it when it is open. It
does not emit events. The optional target is the anchor element for
the open, or its ID. The promise resolves to true when the state
changes.
toggle(target: string | HTMLElement): Promise<boolean> Defined in src/components/dropdown/dropdown.ts:500
Parameters
- target:
string | HTMLElement