TidalUI

Combobox preview

A controlled searchable single-selection field with native form value, accessible active-option keyboard behavior, and consumer-owned re…

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/combobox

Import components/ui/tidal.css, components/ui/combobox.css. Wrap installed components in tidal-scope.

Preview

Combobox component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/combobox.css";
import{TidalCombobox}from"./components/ui/combobox";
export default(p:Parameters<typeof TidalCombobox>[0])=><div className="tidal-scope"><TidalCombobox {...p}/></div>;

API and props

TidalCombobox.formValue (required)
string

Required form value value accepted by this exported component.

TidalCombobox.label (required)
ReactNode

Required label value accepted by this exported component.

TidalCombobox.name (required)
string

Required name value accepted by this exported component.

TidalCombobox.onActiveOptionChange (required)
(optionId: string | undefined, event: TidalComboboxActiveEvent) => void

Callback invoked when the active option change interaction is proposed.

TidalCombobox.onOpenChange (required)
(open: boolean, event: TidalComboboxOpenEvent) => void

Receives native React interaction events, or a stable deferred-pointer-blur envelope after an outside pointer activation.

TidalCombobox.onQueryChange (required)
(value: string, event: ChangeEvent<HTMLInputElement>) => void

Callback invoked when the query change interaction is proposed.

TidalCombobox.onSelectionChange (required)
(option: TidalComboboxOption, event: TidalComboboxSelectionEvent) => void

Callback invoked when the selection change interaction is proposed.

TidalCombobox.open (required)
boolean

Required open value accepted by this exported component.

TidalCombobox.options (required)
ReadonlyArray<TidalComboboxOption>

Required options value accepted by this exported component.

TidalCombobox.query (required)
string

Required query value accepted by this exported component.

TidalCombobox.activeOptionId
string | undefined

Optional active option id value accepted by this exported component.

TidalCombobox.description
ReactNode

Optional description value accepted by this exported component.

TidalCombobox.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalCombobox.emptyMessage
ReactNode

Optional empty message value accepted by this exported component.

TidalCombobox.error
ReactNode

Optional error value accepted by this exported component.

TidalCombobox.form
string | undefined

Optional form value accepted by this exported component.

TidalCombobox.hiddenInputProps
Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "form" | "name" | "type" | "value" | "defaultValue" | "children" | "dangerouslySetInnerHTML" | "readOnly"> | undefined

Optional hidden input props value accepted by this exported component.

TidalCombobox.hiddenInputRef
Ref<HTMLInputElement> | undefined

Optional hidden input ref value accepted by this exported component.

TidalCombobox.hint
ReactNode

Optional hint value accepted by this exported component.

TidalCombobox.inputProps
Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "type" | "value" | "defaultValue" | "role" | "aria-activedescendant" | "aria-autocomplete" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-readonly" | "children" | "dangerouslySetInnerHTML" | "placeholder" | "readOnly"> | undefined

Optional input props value accepted by this exported component.

TidalCombobox.inputRef
Ref<HTMLInputElement> | undefined

Optional input ref value accepted by this exported component.

TidalCombobox.labels
Partial<TidalComboboxLabels> | undefined

Optional labels value accepted by this exported component.

TidalCombobox.placeholder
string | undefined

Optional placeholder value accepted by this exported component.

TidalCombobox.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalCombobox.selectedLabel
ReactNode

Optional selected label value accepted by this exported component.

TidalCombobox.selectedOptionId
string | undefined

Optional selected option id value accepted by this exported component.

TidalCombobox.toggleButtonProps
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-label" | "children" | "dangerouslySetInnerHTML"> | undefined

Optional toggle button props value accepted by this exported component.

TidalCombobox.toggleButtonRef
Ref<HTMLButtonElement> | undefined

Optional toggle button ref value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas