Combobox
import {ComboboxModule} from "@qualcomm-ui/angular/combobox"Overview
- Each combobox uses the
comboboxCollectionhelper to manage the list of options. This creates aListCollectioninstance, documented below.
Examples
Simple
The simple API provides a standalone component with built-in layout.
<div class="flex flex-col gap-4">
<q-combobox
class="w-56"
label="Country"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>
</div>Composite
Build with the composite API for granular control. This API requires you to provide each subcomponent, but gives you full control over the structure and layout.
Open on Click
Use the openOnClick prop to open the combobox when the user clicks on the input.
<q-combobox
class="w-56"
label="Country"
openOnClick
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Input Behavior
Adjust the auto-completion behavior of the combobox with the inputBehavior prop.
<q-combobox
class="w-56"
inputBehavior="autohighlight"
label="Country"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Multiple Selection
Use the multiple prop to enable multiple selection. When this is set, the combobox will always clear the input value when the user selects an option.
Highlight Matching Text
Use the highlightMatchingText prop to highlight the portion of each option that matches the user's input. This provides visual feedback during filtering.
<q-combobox
class="w-56"
highlightMatchingText
label="Country"
name="combobox-highlight"
placeholder="Search countries..."
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>ARIA Label
The Combobox's label is automatically associated with the input element for accessibility. If you omit the label, you should provide the ariaLabel prop to give your combobox an accessible name.
<q-combobox
ariaLabel="Country"
class="w-48"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>NOTE
If you're using the composite API, provide the aria-label attribute to the q-combobox-input element instead.
Content Width
The positioning.sameWidth property controls whether the width of the combobox content matches the width of the input element. The default is true.
<q-combobox
ariaLabel="Country"
class="w-48"
placeholder="Select a country"
[collection]="listCollection.collection()"
[positioning]="{sameWidth: false}"
(inputValueChanged)="onInputChange($event)"
/>Input Icon
Use the icon prop to add an icon to the start of the input element. View our Icon documentation to learn more about using icons in QUI.
<q-combobox
ariaLabel="Country"
class="w-48"
icon="MapPin"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Icon Customization
Provide a custom element using the q-combobox-icon directive to override the default icon. This example features a loading indicator:
<q-combobox
ariaLabel="Country"
class="w-48"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
>
@if (loading()) {
<div q-combobox-icon q-progress-ring size="xs"></div>
}
</q-combobox>Items as Objects
The items prop can be an array of objects. Use the itemLabel and itemValue properties on the comboboxCollection to specify the label and value of each item.
<q-combobox
class="w-48"
label="City"
placeholder="Select a city"
[collection]="cityCollection"
/>Item Customization
When using the simple API, provide the q-combobox-content directive as a child of the <q-combobox> component to override the default item renderer. The following example demonstrates how to add a custom icon to each item:
<q-combobox
class="w-56"
label="Country"
placeholder="Select a country"
[collection]="listCollection.collection()"
[icon]="valueIcon()"
[(ngModel)]="value"
(inputValueChanged)="onInputChange($event)"
>
<div q-combobox-content>
<div q-combobox-empty>No results found</div>
@for (
item of listCollection.collection().items;
track listCollection.collection().getItemValue(item)
) {
<div q-combobox-item [item]="item">
<svg [qIcon]="item.icon"></svg>
<span q-combobox-item-text>
{{ listCollection.collection().stringifyItem(item) }}
</span>
<span q-combobox-item-indicator></span>
</div>
}
</div>
</q-combobox>TIP
When you override the default item renderer, certain props like highlightMatchingText and emptyText won't have any effect. Refer to the source code to learn more about the built-in item renderer.
Async Loading
This example shows how to load items asynchronously and display a loading indicator.
<q-combobox
class="w-56"
label="Country"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
>
@if (query.isFetching()) {
<div q-combobox-icon q-progress-ring size="xs"></div>
}
</q-combobox>Virtualized
For large lists, use the virtual prop to improve performance. This virtualizes the visible list items for performant scrolling and searching.
<q-combobox
class="w-56"
label="Country"
placeholder="Select a country"
virtual
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Virtual Item Customization
Use the q-combobox-virtual-content and q-combobox-virtual-item directives to customize virtual item rendering.
<q-combobox
class="w-56"
label="Starship"
placeholder="Search for a Starship"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
>
@if (query.isFetching()) {
<div q-combobox-icon q-progress-ring size="xs"></div>
}
<div q-combobox-virtual-content [virtualOptions]="virtualOptions">
<div q-combobox-empty>No results found</div>
<ng-container *comboboxVirtualizer="let virtualizer">
@for (
virtualItem of virtualizer.getVirtualItems();
track virtualItem.key
) {
@let item = listCollection.collection().items.at(virtualItem.index);
<div
q-combobox-virtual-item
style="height: 52px"
[virtualItem]="virtualItem"
>
<div class="flex flex-col gap-0.5" q-combobox-item-text>
<div class="font-body-xs-bold">{{ item!.name }}</div>
<div class="font-body-xs overflow-x-hidden text-ellipsis">
{{ item!.url }}
</div>
</div>
<span q-combobox-item-indicator></span>
</div>
}
</ng-container>
</div>
</q-combobox>Sizes
This component supports three size options to accommodate different layout densities and design requirements.
The available sizes are sm, md, and lg. The default size is md.
Content Height
Change the height of the item container by adjusting the style of the Content element.
Controlled State
Set the initial value using the defaultValue prop, or use value and valueChanged to control the value manually. These props follow our controlled state pattern.
<q-combobox
ariaLabel="Country"
class="w-48"
placeholder="Select a country"
[collection]="listCollection.collection()"
[(ngModel)]="value"
(inputValueChanged)="onInputChange($event)"
/>States
The following shows how the Combobox component appears in each interactive state.
Error Text and Indicator
Error messages are displayed using two props:
The error text and indicator will only render when invalid is true.
<q-combobox
ariaLabel="Country"
class="w-48"
errorText="You must select a country"
invalid
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Hint Text
Use the hintText prop to provide additional context or instructions below the combobox.
<q-combobox
class="w-56"
hint="Choose your country of residence"
label="Country"
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Within Dialog
To use the Combobox within a Dialog, you need to avoid portalling the item dropdown. To do this using the simple API, set disablePortal property to true:
<q-combobox
ariaLabel="Country"
class="w-48"
disablePortal
placeholder="Select a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Within Popover
Like with the Dialog, you need to avoid portalling the q-combobox-positioner:
<div q-popover>
<div q-popover-anchor>
<button q-button q-popover-trigger variant="outline">Click Me</button>
</div>
<q-combobox
disablePortal
label="Country"
placeholder="Search for a country"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>
</div>Forms
- All form control values are arrays to support multiple selections.
- The value of the form control is an array of type
T, whereTis the type of the items in your combobox collection.
Template Forms
Strings
readonly value = signal<string[]>([countries[0]])Objects
readonly value = signal<Country[]>([{id: "US", name: "United States"}])States
When using template forms, the disabled, readOnly, and invalid properties govern the interactive state of the control.
<q-combobox
disabled
label="Disabled"
placeholder="Disabled"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>
<q-combobox
label="Read only"
placeholder="Read only"
readOnly
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>
<q-combobox
errorText="Invalid"
invalid
label="Invalid"
placeholder="Invalid"
[collection]="listCollection.collection()"
(inputValueChanged)="onInputChange($event)"
/>Required
When using template forms, pass the required property to the form control. This applies the RequiredValidator and MinLengthValidator to the form control.
<q-combobox
class="w-48"
errorText="Please select a country"
label="Country"
placeholder="Select a country"
required
[collection]="listCollection.collection()"
[(ngModel)]="value"
(inputValueChanged)="onInputChange($event)"
/>Reactive Forms
Strings
readonly formControl = new FormControl<string[]>([countries[0]])Objects
readonly formControl = new FormControl<Country[]>([
{id: "US", name: "United States"},
])State Guidelines
The disabled, invalid, and required properties have no effect when using Reactive Forms. Use the equivalent Reactive Form bindings instead:
disabledField = new FormControl([])
invalidField = new FormControl([], {
validators: [Validators.required, Validators.minLength(1)],
})
requiredField = new FormControl([], {
validators: [Validators.required, Validators.minLength(1)],
})
ngOnInit() {
this.disabledField.disable()
this.invalidField.markAsDirty()
}API
<q-combobox>
The simple combobox extends the q-combobox-root directive with the following properties:
| Prop | Type | Default |
|---|---|---|
string | ||
When true, renders a clear button that resets the input value on click.
The button only appears when the input has a value. | boolean | true |
Set to true to disable portalling behavior for the combobox dropdown content. | boolean | |
Text to display when no items match the filter. | string | 'No results found' |
string | ||
To customize the element, provide it using the directive instead: <div q-combobox-error-text>...</div> | ||
Set to true to highlight option text matches during filtering. | boolean | |
Optional hint describing the element. This element is automatically
associated with the component's input element for accessibility. | string | |
To customize the element, provide it using the directive instead: <div q-combobox-hint>...</div> | ||
Optional label describing the element. Recommended. This element is
automatically associated with the component's input element for
accessibility. | string | |
To customize the element, provide it using the directive instead: <div q-combobox-label>...</div> | ||
When true, the list items will be virtually rendered. Useful for large lists. | boolean | |
stringbooleantrue, renders a clear button that resets the input value on click.
The button only appears when the input has a value.booleanstringstring<div q-combobox-error-text>...</div>
booleantrue to highlight option text matches during filtering.string<div q-combobox-hint>...</div>
string<div q-combobox-label>...</div>
booleantrue, the list items will be virtually rendered. Useful for large lists.Composite API
q-combobox-root
| Prop | Type | Default |
|---|---|---|
The item collection | ||
Whether to allow custom values that are not in the collection | boolean | false |
Whether to always submit on Enter key press, even if popup is open | boolean | false |
Whether to autofocus the input on mount | boolean | |
Whether the combobox should close after an item is selected | boolean | false |
Whether the combobox is a composed with other composite widgets | boolean | true |
The initial value of the highlighted item when opened.
Use when you don't need to control the highlighted value of the combobox. | string | |
The initial value of the input when opened. | string | |
Whether the combobox's open state is controlled by the user | boolean | |
The initial state of the input when rendered. Use when you don't need to
control the checked state of the input. This property will be ignored if you
opt into controlled state via form control bindings. | InputSigna | |
The document's text/writing direction. | 'ltr' | 'rtl' | "ltr" |
Controls whether the input is disabled in template-driven forms. When true,
prevents user interaction and applies visual styling to indicate the disabled
state. | boolean | |
Whether to disable registering this as a dismissable layer | boolean | |
A root node to correctly resolve the Document in custom environments. i.e.,
Iframes, Electron. | () => | |
The controlled key of the highlighted item | string | |
lucide icon, positioned at the start of the control element. | | LucideIconData | |
id attribute. If
omitted, a unique identifier will be generated for accessibility.) | string | |
Whether to synchronize the present change immediately or defer it to the next
frame. | boolean | false |
Defines the auto-completion behavior of the combobox | | 'none' | "none" |
The value of the input | string | |
Controls the visual error state of the input. When true, applies semantic error
styling to indicate validation failure. | boolean | |
When true, the component will not be rendered in the DOM until it becomes
visible or active. | boolean | false |
Whether to loop the keyboard navigation through the options | boolean | false |
Whether to allow multiple selection | boolean | false |
The name of the input field. Useful for form submission. | string | |
Whether the combobox menu is open | boolean | |
Whether to show the combobox when the input value changes | boolean | true |
Whether to open the combobox popup on click | boolean | true |
Whether to open the combobox on arrow key press | boolean | true |
Placeholder text to display when no value is selected. | string | "Select option" |
The positioning options of the menu. | PositioningOptions | |
The controlled presence of the node. | boolean | |
Whether the input is read-only. When true, prevents user interaction while
keeping the input focusable and visible. | boolean | |
Controls whether the input is required in template-driven forms. When
true, the input must have a value for form validation to pass. | boolean | |
Function to scroll to a specific index | (details: { | |
The behavior of the combobox input when an item is selected - replace: The selected item string is set as the input value- clear: The input value is cleared- preserve: The input value is preserved | | 'replace' | "replace" |
The size of the combobox and its elements. Governs properties like font size,
item padding, and icon sizes. | | 'sm' | 'md' |
Whether to allow the initial presence animation. | boolean | false |
Specifies the localized strings | { | |
When true, the component will be completely removed from the DOM when it
becomes inactive or hidden, rather than just being hidden with CSS. | boolean | false |
Function called when the animation ends in the closed state | void | |
Function called when the focus is moved outside the component | CustomEvent<{ | |
The callback fired when the highlighted item changes. | { | |
The callback fired when the input value changes | { | |
Function called when an interaction happens outside the component | | CustomEvent<{event?: E}> | |
Function invoked when the popup opens or closes | { | |
Function called when the pointer is pressed down outside the component | CustomEvent<{ | |
The callback fired when the selected item changes. | { |
booleanbooleanbooleanbooleanbooleanstringstringbooleanInputSigna'ltr' | 'rtl'
booleanboolean() =>
| Node
| ShadowRoot
| Document
string| LucideIconData
| string
stringboolean| 'none'
| 'autohighlight'
| 'autocomplete'
stringbooleanbooleanbooleanbooleanstringbooleanbooleanbooleanbooleanstringPositioningOptionsbooleanbooleanboolean(details: {
getElement: () => HTMLElement
immediate?: boolean
index: number
}) => void
| 'replace'
| 'clear'
| 'preserve'
-
replace: The selected item string is set as the input value-
clear: The input value is cleared-
preserve: The input value is preserved| 'sm'
| 'md'
| 'lg'
boolean{
clearTriggerLabel?: string
triggerLabel?: string
}
booleanvoidCustomEvent<{
event?: E
}>
{
value: string
} & {
highlightedItem: T
highlightedValue: string
}
{
inputValue: string
reason?:
| 'input-change'
| 'item-select'
| 'clear-trigger'
| 'script'
| 'interact-outside'
}
| CustomEvent<{event?: E}>
| CustomEvent<{event?: E}>
{
open: boolean
reason?:
| 'input-click'
| 'trigger-click'
| 'script'
| 'arrow-key'
| 'input-change'
| 'interact-outside'
| 'escape-key'
| 'item-select'
| 'clear-trigger'
}
CustomEvent<{
event?: E
}>
{
items: Array<T>
value: string[]
}
QdsComboboxRootBindingsq-combobox-label
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-select__label' |
data-disabled | |
data-focus | |
data-invalid | |
data-part | 'label' |
data-readonly | |
data-required | |
data-scope | 'combobox' |
class'qui-select__label'data-disableddata-focusdata-invaliddata-part'label'data-readonlydata-requireddata-scope'combobox'q-combobox-control
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-select__control' |
data-disabled | |
data-focus | |
data-invalid | |
data-part | 'control' |
data-scope | 'combobox' |
data-size | | 'sm' |
data-state | | 'open' |
class'qui-select__control'data-disableddata-focusdata-invaliddata-part'control'data-scope'combobox'data-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
q-combobox-input
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-input__input' |
data-autofocus | |
data-invalid | |
data-part | 'input' |
data-scope | 'combobox' |
data-size | | 'sm' |
data-state | | 'open' |
class'qui-input__input'data-autofocusdata-invaliddata-part'input'data-scope'combobox'data-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
q-combobox-trigger
| Prop | Type |
|---|---|
Whether the trigger is focusable | boolean |
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
booleanstring| Attribute / Property | Value |
|---|---|
class | 'qui-select__indicator' |
data-disabled | |
data-focusable | |
data-invalid | |
data-part | 'trigger' |
data-readonly | |
data-scope | 'combobox' |
data-size | | 'sm' |
data-state | | 'open' |
tabIndex | -1 |
class'qui-select__indicator'data-disableddata-focusabledata-invaliddata-part'trigger'data-readonlydata-scope'combobox'data-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
tabIndex-1
q-combobox-clear-trigger
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-select__clear-trigger' |
data-invalid | |
data-part | 'clear-trigger' |
data-scope | 'combobox' |
data-size | | 'sm' |
hidden | boolean |
tabIndex | -1 |
class'qui-select__clear-trigger'data-invaliddata-part'clear-trigger'data-scope'combobox'data-size| 'sm'
| 'md'
| 'lg'
hiddenbooleantabIndex-1
q-combobox-positioner
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-select__positioner' |
data-part | 'positioner' |
data-scope | 'combobox' |
style |
class'qui-select__positioner'data-part'positioner'data-scope'combobox'styleq-combobox-content
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-select__content' |
data-disabled | |
data-empty | |
data-focus-visible | |
data-part | 'content' |
data-placement | | 'bottom' |
data-scope | 'combobox' |
data-state | | 'open' |
hidden | boolean |
tabIndex | -1 |
class'qui-select__content'data-disableddata-emptydata-focus-visibledata-part'content'data-placement| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
data-scope'combobox'data-state| 'open'
| 'closed'
hiddenbooleantabIndex-1
q-combobox-item
| Prop | Type |
|---|---|
The item to render, from the collection | any |
Whether hovering outside should clear the highlighted state | boolean |
anyboolean| Attribute / Property | Value |
|---|---|
class | 'qui-select__item' |
data-disabled | |
data-highlighted | |
data-part | 'item' |
data-scope | 'combobox' |
data-size | | 'sm' |
data-state | | 'checked' |
data-value | string |
tabIndex | -1 |
class'qui-select__item'data-disableddata-highlighteddata-part'item'data-scope'combobox'data-size| 'sm'
| 'md'
| 'lg'
data-state| 'checked'
| 'unchecked'
data-valuestringtabIndex-1
q-combobox-item-indicator
| Attribute / Property | Value |
|---|---|
data-part | 'item-indicator' |
data-scope | 'combobox' |
data-state | | 'checked' |
hidden | boolean |
data-part'item-indicator'data-scope'combobox'data-state| 'checked'
| 'unchecked'
hiddenbooleanq-combobox-item-text
| Attribute / Property | Value |
|---|---|
class | 'qui-select__item-text' |
data-disabled | |
data-highlighted | |
data-part | 'item-text' |
data-scope | 'combobox' |
data-state | | 'checked' |
class'qui-select__item-text'data-disableddata-highlighteddata-part'item-text'data-scope'combobox'data-state| 'checked'
| 'unchecked'
q-combobox-hint
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-input__hint' |
data-disabled | |
data-part | 'hint' |
data-scope | 'combobox' |
class'qui-input__hint'data-disableddata-part'hint'data-scope'combobox'q-combobox-error-text
| Prop | Type |
|---|---|
Optional error indicator icon. | | string |
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
| string
| LucideIconData
string| Attribute / Property | Value |
|---|---|
class | 'qui-input__error-text' |
data-part | 'error-text' |
data-scope | 'combobox' |
hidden | boolean |
class'qui-input__error-text'data-part'error-text'data-scope'combobox'hiddenbooleanq-combobox-error-indicator
| Prop | Type | Default |
|---|---|---|
lucide-angular icon | | LucideIconData | CircleAlert |
| LucideIconData
| string
| Attribute / Property | Value |
|---|---|
data-part | 'error-indicator' |
data-scope | 'combobox' |
hidden | boolean |
data-part'error-indicator'data-scope'combobox'hiddenbooleanData Structures
ListCollection
The following describes the member variables and methods of the ListCollection class. The Combobox component uses an instance of this class as input:
@Component({
template: `
<q-combobox [collection]="collection" />
`,
})
export class MyComponent {
collection = comboboxCollection({
items: [
// ...
],
})
}Note that the ListCollection accepts a single generic type parameter, T, which is the type of each list item used in the collection. This can be a string or an object.
Constructor
| Prop | Type |
|---|---|
Function to group items | ( |
Function to sort items | | string[] |
Function to determine if a node is disabled. | ( |
Function to get the item's label. | ( |
The options of the select | | Iterable<T, any, any> |
Function to get the item's unique value. | ( |
(
item: T,
index: number,
) => string
| string[]
| 'desc'
| 'asc'
| ((
a: string,
b: string,
) => number)
(
item: T,
) => boolean
(
item: T,
) => string
| Iterable<T, any, any>
| Readonly<
Iterable<T, any, any>
>
(
item: T,
) => string
| Prop | Type |
|---|---|
Append items to the collection | ( |
Get the item based on its index | ( |
Compare two values | ( |
Copy the collection | (items Array<T>,) => ListCollection<T> |
Filter the collection | ( |
Get the item based on its value | ( |
Get the items based on its values | ( |
Returns the first value in the collection | string |
Whether an item is disabled | ( |
Convert an item to a value | ( |
Returns the next value in the collection | ( |
Returns the previous value in the collection | ( |
Get the range of values between two values | ( |
Returns all the values in the collection | ( |
Group items by the groupBy function provided in options
Returns an array of [groupKey, items] tuples | () => Array< |
Whether the collection has a value | ( |
Whether the collection has an item | ( |
Get the index of an item based on its key | ( |
Insert items at a specific index | ( |
Insert items after a specific value | ( |
Insert items before a specific value | ( |
Check if the collection is equal to another collection
| ( |
The items in the collection | Array<T> |
Returns the last value in the collection | string |
Move an item to a specific index | ( |
Move items after a specific value | ( |
Move items before a specific value | ( |
Prepend items to the collection | ( |
Remove items from the collection | ( |
Reorder items | ( |
Search for a value based on a query | ( |
Function to update the collection items | ( |
Returns the number of items in the collection | number |
Sort the values based on their index | ( |
Convert a value to a string | ( |
Convert an item to a string | ( |
Convert an array of items to a string | ( |
Convert an array of items to a string | (value: string[],separator string,) => string |
Convert the collection to a JSON object | () => { |
Convert the collection to a string | () => string |
Update an item in the collection | ( |
Update an item in the collection if it exists, otherwise append it | ( |
(
items: Array<T>,
) => ListCollection<T>
(
index: number,
) => T
(
a: string,
b: string,
) => -1 | 0 | 1
(items Array<T>,) => ListCollection<T>
(
fn: (
itemString: string,
index: number,
item: T,
) => boolean,
) => ListCollection<T>
(
value: string,
) => T
(
values: string[],
) => Array<T>
string(
T,
) => boolean
(
T,
) => string
(
value: string,
step: number,
clamp: boolean,
) => string
(
value: string,
step: number,
clamp: boolean,
) => string
(
from: string,
to: string,
) => string[]
(
items: Array<T>,
) => string[]
() => Array<
[string, Array<T>]
>
(
value: string,
) => boolean
(
T,
) => boolean
(
value: string,
) => number
(
index: number,
items: Array<T>,
) => ListCollection<T>
(
value: string,
items: Array<T>,
) => ListCollection<T>
(
value: string,
items: Array<T>,
) => ListCollection<T>
(
any,
) => boolean
- itemsThe items in the collection
Array<T>
string(
value: string,
toIndex: number,
) => ListCollection<T>
(
value: string,
values: string[],
) => ListCollection<T>
(
value: string,
values: string[],
) => ListCollection<T>
(
items: Array<T>,
) => ListCollection<T>
(
itemsOrValues: Array<
string | T
>,
) => ListCollection<T>
(
fromIndex: number,
toIndex: number,
) => ListCollection<T>
(
queryString: string,
{
currentValue: string
state: {
keysSoFar: string
timer: number
}
timeout?: number
},
) => string
(
items: Array<T>,
) => ListCollection<T>
number(
values: string[],
) => string[]
(
value: string,
) => string
(
T,
) => string
(
items: Array<T>,
separator: string,
) => string
(value: string[],separator string,) => string
() => {
first: string
last: string
size: number
}
() => string
(
value: string,
T,
) => ListCollection<T>
(
value: string,
T,
mode: 'append' | 'prepend',
) => ListCollection<T>
ComboboxPositioningOptions
| Prop | Type | Default |
|---|---|---|
The minimum padding between the arrow and the floating element's corner. | number | 4 |
The overflow boundary of the reference element | () => | |
Whether the popover should fit the viewport. | boolean | |
Whether to flip the placement when the floating element overflows the boundary. | | boolean | true |
Function that returns the anchor rect | ( | |
The main axis offset or gap between the reference and floating element | number | 2 |
Whether the popover should be hidden when the reference element is detached | boolean | |
Options to activate auto-update listeners | | boolean | true |
The offset of the floating element | { | |
Function called when the placement is computed | ( | |
Function called when the floating element is positioned or not | (data: { | |
The virtual padding around the viewport edges to check for overflow | number | |
Whether the floating element can overlap the reference element | boolean | false |
The initial placement of the floating element | | 'bottom' | 'bottom-start' |
Whether to make the floating element same width as the reference element | boolean | true |
The secondary axis offset or gap between the reference and floating elements | number | |
Whether the popover should slide when it overflows. | boolean | |
The strategy to use for positioning | | 'absolute' | 'absolute' |
A callback that will be called when the popover needs to calculate its
position. | (data: { |
number() =>
| 'clippingAncestors'
| Element
| Array<Element>
| {
height: number
width: number
x: number
y: number
}
boolean| boolean
| Array<
| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
>
(
element:
| HTMLElement
| VirtualElement,
) => {
height?: number
width?: number
x?: number
y?: number
}
numberboolean| boolean
| {
ancestorResize?: boolean
ancestorScroll?: boolean
animationFrame?: boolean
elementResize?: boolean
layoutShift?: boolean
}
{
crossAxis?: number
mainAxis?: number
}
(
data: ComputePositionReturn,
) => void
(data: {
placed: boolean
}) => void
numberboolean| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
booleannumberboolean| 'absolute'
| 'fixed'
(data: {
updatePosition: () => Promise<void>
}) => void | Promise<void>