Select Input

Commonly used select input component.

Installation

npx wdc add select

Single Selection Examples

Basic Usage

Select from a simple array of strings.

Binding Objects

Bind to object properties using bindLabel and bindValue.

Binding directly to a WritableSignal

Signal Value: IN

States

Error, success, and disabled states.

Please select your country.

Multiple Selection Examples

Basic Usage

Select multiple strings from a list.

Object Binding

Select multiple objects by binding ID.

Validation States

Consistent error styling with single select and inputs.

At least one tag is required.

API Reference

InputTypeDefaultDescription
optionsany[]requiredArray of items to display in the dropdown.
bindLabelstring'label'Property name to display as the label (e.g., "name").
bindValuestring'value'Property name to use as the value (e.g., "id").
searchablebooleantrueEnables a search input inside the dropdown.
labelstring''Label displayed above the select trigger.
placeholderstring'Select an option'Placeholder text when no value is selected.
check_circle
SEO & Accessibility

The select component uses a button trigger with aria-expanded and a proper label. While custom select menus are harder for crawlers than native , this implementation follows accessibility guidelines (WAI-ARIA) ensuring screen readers can announce the label and state correctly.