Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ComboboxProps<TData>

Type parameters

Hierarchy

Index

Properties

Optional as

as: string | Element

Optional classNames

classNames: RootClassName & Record<keyof ComboboxStyles, string>

Class names for the root component and the subcomponents.

Optional component

component: RenderFunction<{ store: ComboboxStoreById<undefined> }>

Render this component when the combobox is open (useful to inject hooks).

Optional controlled

controlled: boolean

Is opening/closing the combobox controlled by the client.

Optional filter

filter: (search: string) => (item: TComboboxItem<TData>) => boolean

Items filter function by text.

default

(value) => value.text.toLowerCase().startsWith(search.toLowerCase())

Type declaration

id

id: string

Combobox id.

Optional items

items: TComboboxItem<TData>[]

Unfiltered items.

Optional maxSuggestions

maxSuggestions: number

Max number of items.

default

items.length

Optional onRenderItem

onRenderItem: RenderFunction<ComboboxItemProps<TData>>

Render combobox item.

default

text

onSelectItem

onSelectItem: null | ComboboxOnSelectItem<TData>

Called when an item is selected.

Optional portalElement

portalElement: Element

Optional prefixClassNames

prefixClassNames: string

Optional searchPattern

searchPattern: string

Regular expression for search, for example to allow whitespace

Optional sort

sort: (search: string) => (a: TComboboxItem<TData>, b: TComboboxItem<TData>) => number

Sort filtered items before applying maxSuggestions.

Type declaration

Optional styles

styles: Partial<RootStyles> & Partial<ComboboxStyles>

Customized styling that will layer on top of the default rules.

trigger

trigger: string

Trigger that activates the combobox.

Generated using TypeDoc