Skip to content

Combobox

Filters and selects an option from large sets while preserving form value and keyboard navigation.

Design

Functional preview

Running with the stable ds-tis/combobox JavaScript runtime.

Loading functional preview…

Anatomy

  • Brazil

Type to filter countries.

1 Field (.ds-combobox) — wrapper with input, icon, clear, and chevron.
2 Input (.ds-combobox__input) — editable text with role="combobox".
3 Icon (.ds-combobox__icon) — optional, decorative.
4 Listbox (.ds-combobox__listbox) — popup with filterable options.
5 Option (.ds-combobox__option) — selectable item with role="option".
6 Label and helper — external via ds-field (ADR-017).

Default

Type to filter countries.

Open listbox

Compose with ds-field for label, helper, and error. Wrap .ds-combobox and .ds-combobox__listbox in .ds-combobox-anchor to position the popup. The public ds-tis/combobox module (initComboboxes / destroyComboboxes) is required for open state, filtering, selection, and keyboard. Event: ds-combobox-change.

  • Argentina
  • Brazil
  • Chile
  • Colombia (unavailable)

Type to filter countries.

Sizes

SizeHeightPadding
Small (--sm)component.combobox.height.sm (32px)component.combobox.padding-x.sm
Medium (--md)component.combobox.height.md (40px)component.combobox.padding-x.md
Large (--lg)component.combobox.height.lg (48px)component.combobox.padding-x.lg

States

Error

Please select a country.

Disabled

Read-only

Figma API

The live component set composes the shared field (ADR-019) with a local listbox. State covers Default, Hover, Focus, and Disabled; Filled, Error, and Read-only are separate properties, like Select.

PropertyTypeRepo equivalent
Show LabelBOOLEANds-field + .ds-field__label
LabelTEXT.ds-field__label
PlaceholderTEXTplaceholder no input
ContentTEXTvalor preenchido em .ds-combobox__input
Show Left Icon / Left IconBOOLEAN / INSTANCE_SWAP.ds-combobox__icon
Show Clear Button / Clear IconBOOLEAN / INSTANCE_SWAP.ds-combobox__clear
Chevron IconINSTANCE_SWAP.ds-combobox__chevron
Show Helper Text / Helper TextBOOLEAN / TEXT.ds-field__helper
Error MessageTEXT.ds-field__error + ds-combobox--error
SizeVARIANTds-combobox--sm / --md / --lg
StateVARIANTDefault, Hover, Focus, Disabled
Filled / Error / Read-onlyBOOLEANds-combobox--filled, --error, --readonly