<Combobox> Component

Default, batteries-included typeahead combobox

Share
Code Editor

Props

NameDescription
label*
string
A label for the combobox, used directly for aria-label
options*
array
Array of string values for the dropdown options
onSelect
function
A handler called when a new option is selected, takes the newly selected option value as its only parameter
inputProps
object
Props passed to the combobox input, props listed below are not an exhaustive list, conforms to React's InputHTMLAttributes
Object contains nested props, see below:
inputProps.onChange
function
A onChange handler for the input
inputProps.onBlur
function
An onBlur handler for the input
openOnFocus
boolean
Controls whether the dropdown opens on focus of the input
buttonLabel
string
Accessible label for the dropdown button
invalidInputValue
boolean
Declaratively mark the input as invalid, useful for form inputs (validation)
renderOption
function
Render function to customize the display of options

Other Examples

With custom option component

Share
Code Editor

With composition of components

Share
Code Editor

Example Form

Share
Code Editor