Navigated to /docs/ui/components/combobox

Combobox

Input with datalist-backed option suggestions.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { Combobox } from "@tavojs/ui/combobox";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/combobox.

When to use

Use it when

Use `Combobox` for datalist-backed suggestions

Choose something else when

Avoid Combobox when wrapping controls without labels or accessible names.

Examples

Combobox example

TSX
tsximport { Combobox } from "@tavojs/ui/combobox";

export function ComboboxExample1() {
  return (
    <>
      <Combobox name="framework" options={[{ label: "Tavo.js", value: "tavo" }]} />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
namestring

Required

Configures name for this component.
options{ label: string; value: string }[]

Required

Configures options for this component.
sizeSize

Configures size for this component.
listIdstring

Configures listId for this component.

Complete TypeScript API

Import from @tavojs/ui/combobox. Published exports: Combobox, ComboboxOption, ComboboxProps.

ComboboxProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Combobox.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Combobox.

idstring

No

Inherited id attribute accepted by Combobox.

rolestring

No

Inherited role attribute accepted by Combobox.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Combobox.

titlestring

No

Inherited title attribute accepted by Combobox.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Combobox.

hiddenboolean

No

Inherited hidden attribute accepted by Combobox.

disabledboolean

No

Inherited disabled attribute accepted by Combobox.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Combobox.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Combobox.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Combobox.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Combobox.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Combobox.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Combobox.

namestring

No

Configures name for this component.

optionsComboboxOption[]

Yes

Configures options for this component.

sizeSize

No

Configures size for this component.

listIdstring

No

Configures listId for this component.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetNative input attributes target the owned form control; wrapper-specific props stay on the documented component root.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid Combobox when wrapping controls without labels or accessible names.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Uses native `input` plus `datalist`.

  • Uses native `input` plus `datalist`.

Component status

ContractCurrent value
Maturitystable
Categoryforms
Component import@tavojs/ui/combobox
Explicit CSS import@tavojs/ui/css/combobox
PreviewInteractive preview available on this page