VDS

Combobox

A searchable dropdown for selecting one option.

Installation

npm install @vds-testing/react @vds-testing/styles
npm install @vds-testing/elements @vds-testing/styles

See Installation for CSS setup.

Usage

React:

import { Combobox } from "@vds-testing/react"
<Combobox
  options={[
    { value: "Vale Shop", label: "https://shop.vade.org/" },
    { value: "Vade.org", label: "https://www.vade.org/" },
  ]}
  placeholder="Select a domain"
/>

Web Components:

<script type="module">
  import "@vds-testing/elements";
</script>
<vds-combobox
  placeholder="Select a domain"
  options='[{"value":"lexington","label":"lexingtonthemes.com"},{"value":"colors-fonts","label":"colorsandfonts.com"}]'
></vds-combobox>

Examples

Clearable

Grouped options

Rich items

Input-group addon

Anatomy

  • Combobox - Root searchable select component.
  • ComboboxTrigger - Trigger button for opening the options list.
  • ComboboxContent - Popover content container.
  • ComboboxItem - Selectable option row.

Props

Combobox

Prop Type Default Description
options ComboboxOption[] | ComboboxGroup[] [] Flat options or grouped options
value string “” Initial selected value
name string - Hidden input name for form submissions
placeholder string “Select an option” Trigger placeholder text
searchPlaceholder string “Search…” Search input placeholder
emptyMessage string “No results found.” Empty state label
disabled boolean false Disables trigger and selection
clearable boolean false Shows clear action when a value is selected
inputGroupControl boolean false Adapts trigger for InputGroup composition
class string - Additional CSS classes
onValueChange (detail: { value, label }) => void - React only. Astro/elements emit combobox-change.

Web Components pass options as a JSON string attribute. Kebab-case attrs: search-placeholder, empty-message, input-group-control.

Events

  • combobox-change - Emitted on selection with { value, label } detail.