Combobox
The Combobox consists of a label, a text-input field, and a chevron icon that indicates the control can expand. The input field contains the current value or placeholder text and is enclosed by a container that provides focus and hover states. Activating the control reveals the dropdown menu, which presents a list of options.
import {Combobox} from "@qualcomm-ui/react/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 bundled subcomponents.
<Combobox
collection={collection}
label="Country"
onInputValueChange={handleInputChange}
placeholder="Select a country"
/>
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.
<Combobox.Root
className="w-56"
collection={collection}
icon={Search}
name="combobox-composite"
onInputValueChange={handleInputChange}
placeholder="Search..."
>
<Combobox.Label>Search</Combobox.Label>
<Combobox.Control>
<Combobox.Input />
<Combobox.ClearTrigger />
<Combobox.Trigger />
</Combobox.Control>
<Portal>
<Combobox.Positioner>
<Combobox.Content>
<Combobox.Empty>No results found</Combobox.Empty>
{collection.items.map((item) => (
<Combobox.Item key={item} item={item}>
<Combobox.ItemText>{item}</Combobox.ItemText>
<Combobox.ItemIndicator>✓</Combobox.ItemIndicator>
</Combobox.Item>
))}
</Combobox.Content>
</Combobox.Positioner>
</Portal>
</Combobox.Root>
Open on Click
Use the openOnClick prop to open the combobox when the user clicks on the input.
<Combobox
collection={collection}
label="Country"
onInputValueChange={handleInputChange}
openOnClick
placeholder="Select a country"
/>
Input Behavior
Adjust the auto-completion behavior of the combobox with the inputBehavior prop.
<Combobox
collection={collection}
inputBehavior="autohighlight"
label="Country"
onInputValueChange={handleInputChange}
placeholder="Select a country"
/>
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.
import {useState} from "react"
import type {ComboboxInputValueChangeDetails} from "@qualcomm-ui/core/combobox"
import {useListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Combobox} from "@qualcomm-ui/react/combobox"
import {Tag} from "@qualcomm-ui/react/tag"
import {countries} from "./country-list"
export function ComboboxMultipleDemo() {
const {contains} = useFilter({sensitivity: "base"})
const [value, setValue] = useState<string[]>([])
const {collection, filter} = useListCollection({
filter: contains,
initialItems: countries,
})
function handleInputChange(details: ComboboxInputValueChangeDetails) {
filter(details.inputValue)
}
function handleValueDismissed(item: string) {
setValue(value.filter((v) => v !== item))
}
return (
<div className="flex w-72 flex-col gap-4">
<div className="flex flex-wrap gap-2">
{value.map((item) => (
<Tag
key={item}
emphasis="neutral"
onClick={() => handleValueDismissed(item)}
variant="dismissable"
>
{item}
</Tag>
))}
</div>
<Combobox
className="w-full"
collection={collection}
label="Country"
multiple
onInputValueChange={handleInputChange}
onValueChange={(details) => setValue(details.value)}
placeholder="Select a country"
value={value}
/>
</div>
)
}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.
<Combobox
className="w-56"
collection={collection}
highlightMatchingText
label="Country"
name="combobox-highlight"
onInputValueChange={handleInputChange}
placeholder="Search countries..."
/>
ARIA Label
The Combobox's label is automatically associated with the input element for accessibility. If you omit the label, you should provide an aria-label to the input to give your combobox an accessible name.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
onInputValueChange={handleInputChange}
placeholder="Select a country"
/>
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.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
onInputValueChange={handleInputChange}
placeholder="Select a country"
positioning={{sameWidth: false}}
/>
Input Icon
Use the icon prop to add an icon to the start of the input element.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
icon={MapPin}
onInputValueChange={handleInputChange}
placeholder="Select a country"
/>
Icon Customization
Supply a ReactNode to the icon prop to customize the icon. This example features a loading indicator:
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
icon={<ProgressRing size="xs" />}
onInputValueChange={handleInputChange}
placeholder="Select a country"
/>
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.
{name: "San Diego", value: "SD"},
{name: "Nashville", value: "NV"},
{name: "Denver", value: "DV"},
{name: "Miami", value: "MI"},
{name: "Las Vegas", value: "LV"},
{name: "New York City", value: "NYC"},
{name: "San Francisco", value: "SF"},
Custom Item Rendering
When using the simple API, use the renderItem prop to customize the rendering of each item.
<Combobox
className="w-72"
collection={collection}
label="Select team member"
onInputValueChange={handleInputChange}
placeholder="Search by name, role, or email"
renderItem={({item, ...itemProps}) => {
const person = item
return (
<Combobox.Item className="min-h-[48px]" item={item} {...itemProps}>
<div className="flex flex-1 flex-col gap-0.5">
<Combobox.ItemText>
<span className="font-body-sm">{person.name}</span>
</Combobox.ItemText>
<div className="font-body-xs flex items-center gap-1">
<span>{person.role}</span>
<span>—</span>
<span>{person.email}</span>
</div>
</div>
<Combobox.ItemIndicator />
</Combobox.Item>
)
}}
/>
WARNING
When rendering custom items with virtual set to true, you must forward the data-virtual and style props to the rendered item:
<Combobox
renderItem={({item, ...itemProps}) => {
return (
<Combobox.Item item={item} {...itemProps}>
{/* ... */}
</Combobox.Item>
)
}}
/>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.
import type {ComboboxInputValueChangeDetails} from "@qualcomm-ui/core/combobox"
import {useListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Combobox} from "@qualcomm-ui/react/combobox"
const cityList = ["San Diego", "Dallas", "Denver"]
export function ComboboxSizesDemo() {
const {contains} = useFilter({sensitivity: "base"})
const {collection, filter} = useListCollection({
filter: contains,
initialItems: cityList,
})
function handleInputChange(details: ComboboxInputValueChangeDetails) {
filter(details.inputValue)
}
return (
<div className="flex flex-col items-center gap-4">
<Combobox
aria-label="City"
className="w-40"
collection={collection}
onInputValueChange={handleInputChange}
placeholder="sm"
positioning={{sameWidth: true}}
size="sm"
/>
<Combobox
aria-label="City"
className="w-48"
collection={collection}
onInputValueChange={handleInputChange}
placeholder="md"
positioning={{sameWidth: true}}
size="md"
/>
<Combobox
aria-label="City"
className="w-56"
collection={collection}
onInputValueChange={handleInputChange}
placeholder="lg"
positioning={{sameWidth: true}}
size="lg"
/>
</div>
)
}Content Height
Change the height of the item container by adjusting the style of the Content element.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
contentProps={{style: {maxHeight: 240}}}
onInputValueChange={handleInputChange}
placeholder="Select a country"
positioning={{sameWidth: true}}
/>
Controlled State
Set the initial value using the defaultValue prop, or use value and onValueChange to control the value manually. These props follow our controlled state pattern.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
onInputValueChange={handleInputChange}
onValueChange={(details) => setValue(details.value)}
placeholder="Select a country"
value={value}
/>
States
The following shows how the Combobox component appears in each interactive state.
<Combobox
className="w-48"
collection={collection}
defaultValue={[countries[0]]}
disabled
label="Disabled"
onInputValueChange={handleInputChange}
/>
<Combobox
className="w-48"
collection={collection}
defaultValue={[countries[0]]}
label="Read only"
onInputValueChange={handleInputChange}
readOnly
/>
<Combobox
className="w-48"
collection={collection}
defaultValue={[countries[0]]}
errorText="Invalid"
invalid
label="Invalid"
onInputValueChange={handleInputChange}
/>
Error Text and Indicator
Error messages are displayed using two props:
The error text and indicator will only render when invalid is true.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
errorText="You must select a country"
invalid={!value.length}
onInputValueChange={handleInputChange}
onValueChange={(details) => setValue(details.value)}
placeholder="Select a country"
value={value}
/>
Hint Text
Use the hint prop to provide additional context or instructions below the combobox.
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
hint="Optional hint"
onInputValueChange={handleInputChange}
placeholder="Select a country"
/>
Within Dialog
To use the Combobox within a Dialog, you need to avoid portalling the Combobox.Positioner to the document's body. To do this using the simple API, set portalProps.disabled to true:
import type {ReactElement} from "react"
import type {ComboboxInputValueChangeDetails} from "@qualcomm-ui/core/combobox"
import {useListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Button} from "@qualcomm-ui/react/button"
import {Combobox} from "@qualcomm-ui/react/combobox"
import {Dialog} from "@qualcomm-ui/react/dialog"
import {countries} from "./country-list"
export function ComboboxWithinDialogDemo(): ReactElement {
const {contains} = useFilter({sensitivity: "base"})
const {collection, filter} = useListCollection({
filter: contains,
initialItems: countries,
})
function handleInputChange(details: ComboboxInputValueChangeDetails) {
filter(details.inputValue)
}
return (
<Dialog.Root>
<Dialog.Trigger>
<Button emphasis="primary" variant="fill">
Open Dialog
</Button>
</Dialog.Trigger>
<Dialog.FloatingPortal>
<Dialog.Body>
<Dialog.Heading>Dialog Title</Dialog.Heading>
<Dialog.CloseButton />
<Combobox
aria-label="Country"
className="w-48"
collection={collection}
onInputValueChange={handleInputChange}
placeholder="Select a country"
portalProps={{disabled: true}}
/>
</Dialog.Body>
<Dialog.Footer>
<Dialog.CloseTrigger>
<Button emphasis="primary" size="sm" variant="fill">
Confirm
</Button>
</Dialog.CloseTrigger>
</Dialog.Footer>
</Dialog.FloatingPortal>
</Dialog.Root>
)
}Within Popover
Like with the Dialog, you need to avoid portalling the Combobox.Positioner to the document's body:
import type {ReactElement} from "react"
import type {ComboboxInputValueChangeDetails} from "@qualcomm-ui/core/combobox"
import {useListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Button} from "@qualcomm-ui/react/button"
import {Combobox} from "@qualcomm-ui/react/combobox"
import {Popover} from "@qualcomm-ui/react/popover"
import {countries} from "./country-list"
export function ComboboxWithinPopoverDemo(): ReactElement {
const {contains} = useFilter({sensitivity: "base"})
const {collection, filter} = useListCollection({
filter: contains,
initialItems: countries,
})
function handleInputChange(details: ComboboxInputValueChangeDetails) {
filter(details.inputValue)
}
return (
<Popover
label="Combobox Example"
trigger={<Button emphasis="primary">Show Popover</Button>}
>
<Combobox
className="w-48"
collection={collection}
label="Country"
onInputValueChange={handleInputChange}
placeholder="Select a country"
portalProps={{disabled: true}}
/>
</Popover>
)
}Async Loading
This example shows how to load items asynchronously and display a loading indicator.
<Combobox
className="w-56"
collection={collection}
icon={isFetching ? <ProgressRing size="xs" /> : undefined}
inputValue={inputValue}
label="Starship"
onInputValueChange={(details) => setInputValue(details.inputValue)}
placeholder="Search for a starship"
/>
Virtualized
For large lists, use the virtual prop to improve performance. This virtualizes the visible list items for performant scrolling and searching. The following example features a list of 5000 mock usernames.
import {useState} from "react"
import {useAsyncListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Combobox} from "@qualcomm-ui/react/combobox"
import {ProgressRing} from "@qualcomm-ui/react/progress-ring"
import {useMockUsers} from "./use-mock-users"
export function ComboboxVirtualDemo() {
const {data, isFetching} = useMockUsers(5000)
const {contains} = useFilter({sensitivity: "base"})
const [inputValue, setInputValue] = useState<string>("")
const {collection} = useAsyncListCollection<string>({
filter: contains,
filterText: inputValue,
items: data ?? [],
})
return (
<Combobox
className="w-56"
collection={collection}
icon={isFetching ? <ProgressRing size="xs" /> : undefined}
inputBehavior="autohighlight"
inputValue={inputValue}
label="Users"
onInputValueChange={(details) => setInputValue(details.inputValue)}
placeholder="Search for a username"
virtual
/>
)
}Forms
Choose the form library that fits your needs—we've built examples with React Hook Form and Tanstack Form to get you started.
React Hook Form
Use React Hook Form to handle the input state and validation. ArkType works great for schema validation if you need it.
import type {ReactElement} from "react"
import {type} from "arktype"
import {Controller, type SubmitHandler, useForm} from "react-hook-form"
import type {ComboboxInputValueChangeDetails} from "@qualcomm-ui/core/combobox"
import {useListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Button} from "@qualcomm-ui/react/button"
import {Combobox} from "@qualcomm-ui/react/combobox"
import {createToaster, Toaster} from "@qualcomm-ui/react/toast"
import {countries} from "./country-list"
const valueSchema = type({
country: type("string[] > 0").configure({
message: "At least one country must be selected",
}),
})
type ValueSchema = typeof valueSchema.infer
const toaster = createToaster({
overlap: true,
placement: "bottom-end",
})
export function ComboboxHookFormDemo(): ReactElement {
const {contains} = useFilter({sensitivity: "base"})
const {collection, filter} = useListCollection({
filter: contains,
initialItems: countries,
})
function handleInputChange(details: ComboboxInputValueChangeDetails) {
filter(details.inputValue)
}
const {
control,
formState: {isSubmitting},
handleSubmit,
setError,
} = useForm<ValueSchema>({
defaultValues: {
country: [],
},
})
const handleFormSubmit: SubmitHandler<ValueSchema> = (data) => {
const validation = valueSchema(data)
if (validation instanceof type.errors) {
for (const error of validation) {
const field = error.path?.[0] as keyof ValueSchema
if (field) {
setError(field, {
message: error.message,
})
}
}
return
}
toaster.create({
label: "Form submitted",
type: "success",
})
}
return (
<>
<Toaster toaster={toaster} />
<form
className="w-48"
noValidate
onSubmit={(event) => void handleSubmit(handleFormSubmit)(event)}
>
<Controller
control={control}
name="country"
render={({field: {onChange, ...fieldProps}, fieldState: {error}}) => (
<Combobox
className="w-full"
collection={collection}
errorText={error?.message}
invalid={!!error}
label="Country"
onInputValueChange={handleInputChange}
onValueChange={(details) => onChange(details.value)}
placeholder="Select a country"
required
{...fieldProps}
/>
)}
/>
<div className="mt-2 flex w-full justify-end">
<Button
disabled={isSubmitting}
emphasis="primary"
type="submit"
variant="fill"
>
Submit
</Button>
</div>
</form>
</>
)
}Tanstack Form
Tanstack Form handles validation with its built-in validators.
import type {ReactElement} from "react"
import {useForm} from "@tanstack/react-form"
import type {ComboboxInputValueChangeDetails} from "@qualcomm-ui/core/combobox"
import {useListCollection} from "@qualcomm-ui/react-core/collection"
import {useFilter} from "@qualcomm-ui/react-core/locale"
import {Button} from "@qualcomm-ui/react/button"
import {Combobox} from "@qualcomm-ui/react/combobox"
import {createToaster, Toaster} from "@qualcomm-ui/react/toast"
import {countries} from "./country-list"
const toaster = createToaster({
overlap: true,
placement: "bottom-end",
})
export function ComboboxTanstackFormDemo(): ReactElement {
const {contains} = useFilter({sensitivity: "base"})
const {collection, filter} = useListCollection({
filter: contains,
initialItems: countries,
})
function handleInputChange(details: ComboboxInputValueChangeDetails) {
filter(details.inputValue)
}
const form = useForm({
defaultValues: {
country: [] as string[],
},
onSubmit: () => {
toaster.create({
label: "Form submitted",
type: "success",
})
},
})
return (
<>
<Toaster toaster={toaster} />
<form
className="w-48"
noValidate
onSubmit={(e) => {
e.preventDefault()
e.stopPropagation()
form.handleSubmit()
}}
>
<form.Field
name="country"
validators={{
onChange: ({value}) =>
value.length === 0
? "At least one country must be selected"
: undefined,
}}
>
{(field) => (
<Combobox
className="w-full"
collection={collection}
errorText={field.state.meta.errors[0]}
invalid={field.state.meta.errors.length > 0}
label="Country"
onInputValueChange={handleInputChange}
onValueChange={(details) => field.handleChange(details.value)}
placeholder="Select a country"
required
value={field.state.value}
/>
)}
</form.Field>
<div className="mt-2 flex w-full justify-end">
<Button
disabled={form.state.isSubmitting}
emphasis="primary"
type="submit"
variant="fill"
>
Submit
</Button>
</div>
</form>
</>
)
}Tanstack form also supports ArkType.
Explorer
API
<Combobox>
The simple combobox extends the Combobox.Root component with the following props:
stringstring{hidden: true}{
render?:
| Element
| ((
props: Props,
) => Element)
}
booleantrue to highlight option text matches during filtering.PortalProps(
props: Props,
) => Element
booleantrue, the list items will be virtually rendered. Useful for large lists.Composite API
This section describes the elements of the Combobox's composite API.
<Combobox.Root>
booleanbooleanbooleanbooleanbooleanstringstringbooleanstring[]
'ltr' | 'rtl'
booleanbooleanstring() =>
| Node
| ShadowRoot
| Document
stringstringPartial<{
clearTrigger: string
content: string
control: string
errorText: string
hint: string
input: string
label: string
positioner: string
root: string
trigger: string
}>
boolean| 'none'
| 'autohighlight'
| 'autocomplete'
-
autohighlight: The first focused item is highlighted as the user types-
autocomplete: Navigating the listbox with the arrow keys selects the item
and the input is updatedstringbooleanbooleanbooleanbooleanWhen
multiple is true, the selectionBehavior is automatically set to
clear. It's recommended to render the selected items in a separate container.stringname attribute of the combobox's input. Useful for form submissionVoidFunction(
event: FocusOutsideEvent,
) => void
(details: {
highlightedItem: T
highlightedValue: string
}) => void
(details: {
inputValue: string
reason?:
| 'input-change'
| 'item-select'
| 'clear-trigger'
| 'script'
| 'interact-outside'
}) => void
(
event: InteractOutsideEvent,
) => void
(details: {
open: boolean
reason?:
| 'input-click'
| 'trigger-click'
| 'script'
| 'arrow-key'
| 'input-change'
| 'interact-outside'
| 'escape-key'
| 'item-select'
| 'clear-trigger'
| 'input-focus'
}) => void
(
event: PointerDownOutsideEvent,
) => void
(details: {
itemValue: string
value: string[]
}) => void
(details: {
items: Array<T>
value: string[]
}) => void
boolean| boolean
| ((details: {
inputValue: string
reason?:
| 'input-change'
| 'item-select'
| 'clear-trigger'
| 'script'
| 'interact-outside'
}) => boolean)
booleanbooleanstringbooleanboolean| ReactElement
| ((
props: object,
) => ReactElement)
boolean(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| 'checkmark'
| 'checkbox'
| 'sm'
| 'md'
| 'lg'
boolean{
listLabel?: string
}
booleanstring[]
<Combobox.Label>
<label> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__label'data-combobox-part'label'data-disableddata-focusdata-invaliddata-readonlydata-required<Combobox.Control>
<div> element
by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__control'data-combobox-part'control'data-disableddata-focusdata-invaliddata-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
<Combobox.Input>
<input> element
by default.className'qui-input__input'data-autofocusdata-combobox-part'input'data-invaliddata-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
<Combobox.Trigger>
<button> element by default.boolean| ReactNode
| LucideIcon
| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__indicator'data-combobox-part'trigger'data-disableddata-focusabledata-invaliddata-readonlydata-size| 'sm'
| 'md'
| 'lg'
data-state| 'open'
| 'closed'
tabIndex-1
<Combobox.ClearTrigger>
<button> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__clear-trigger'data-combobox-part'clear-trigger'data-invaliddata-size| 'sm'
| 'md'
| 'lg'
hiddenbooleantabIndex-1
<Combobox.Positioner>
<div> element by
default.| ReactElement
| ((
props: object,
) => ReactElement)
<Combobox.Content>
<div> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__content'data-combobox-part'content'data-disableddata-emptydata-focus-visibledata-placement| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
data-state| 'open'
| 'closed'
hiddenbooleantabIndex-1
<Combobox.Item>
<div> element by default.Tboolean| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__item'data-combobox-part'item'data-disableddata-highlighteddata-selection-indicator| 'checkmark'
| 'checkbox'
data-size| 'sm'
| 'md'
| 'lg'
data-state| 'checked'
| 'unchecked'
data-valuestringtabIndex-1
<Combobox.ItemIndicator>
<span>
element by default.| ReactElement
| ((
props: object,
) => ReactElement)
data-combobox-part'item-indicator'data-state| 'checked'
| 'unchecked'
hiddenboolean<Combobox.ItemText>
<span> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-select__item-text'data-combobox-part'item-text'data-disableddata-highlighteddata-state| 'checked'
| 'unchecked'
<Combobox.Hint>
<div> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-input__hint'data-disableddata-select-part'hint'hiddenboolean<Combobox.ErrorText>
<div> element by
default.| LucideIcon
| ReactNode
| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-input__error-text'data-select-part'error-text'hiddenboolean<Combobox.ErrorIndicator>
<div> element
by default.| LucideIcon
| ReactNode
| ReactElement
| ((
props: object,
) => ReactElement)
data-combobox-part'error-indicator'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:
const collection = comboboxCollection({
items: [
// ...
],
})
return <Combobox collection={collection} />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
(
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
(
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
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
numberstring[data-menu-part=arrow]).() =>
| '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>
<div>element by default.