Combobox
Also called an autocomplete or autosuggest component. A "combobox" is a plain
text input that can provide a list of suggestions. The <Combobox>
allows any
text value
but also provides a list of auto complete options to select from.
#
Textbox with suggestionsMix and match props like hideCaret
and hideEmptyPopup
props to create a
traditional autocomplete look.
#
Keyboard ShortcutsCombobox implements many keyboard shortcuts for power or keyboard only users.
#
APIautoFocus#
Pass focus to the Combobox when it mounts.
autoSelectMatches#
If a data
item matches the current typed value select it automatically.
busy#
Controls the loading/busy spinner visibility. Presentational only! Useful for providing visual feedback while data is being loaded.
busySpinner#
Specify the element used to render the busy indicator
containerClassName#
Adds a css class to the input container element.
data#
An array of possible values for the Combobox.
Tip: When data
is an array of objects
consider specifying
textField
and dataKey
as well.
[]
dataKey#
A property name that provides the value of the data
items.
This value is used to uniquely distinigush items from others in the data
list.
Generally, dataKey
points to an Id field, or other unique identifier.
When not provided, the referential identity of each data item is used.
defaultOpen#
false
defaultValue#
''
disabled#
dropUp#
Controls the opening direction of the Combobox popup.
filter#
Enable and customize filtering behavior for the Combobox. Specify
one of the built-in methods ("startsWith"
"eq"
"contains"
)
or provide a function that returns true
or false
for each passed in item
(analogous to the array.filter builtin)
You can explicitly disable filtering by setting filter
to false
.
true
focusFirstItem#
false
groupBy#
To display grouped lists, specify a property name, or accesor function,
whose value is used to group the data
list.
The groupBy
value is also used as the text for group headings when groupComponent
is not provided.
hideCaret#
Hide the combobox dropdown indicator.
hideEmptyPopup#
Do not show the auto complete list when it returns no results.
inputProps#
An object of props that is passed directly to the underlying input component.
listComponent#
<List>
listProps#
An object of props that is passed directly to the underlying List
component.
messages#
Object hash containing display text and/or text for screen readers.
Use the messages
object to localize widget text or provide custom rendering.
name#
The HTML name
attribute, passed directly to the input element.
onChange#
A callback fired when the current value
changes.
onSelect#
This handler fires when an item has been selected from the list. It fires before the onChange
handler and fires
regardless of whether the value has actually changed.
onToggle#
A callback fired with the Combobox's popup visibility is about to change.
Use in conjunction with the open
prop to manually control the popup visibility.
open#
Controls the visibility of the Combobox popup. Use defaultOpen
to set an initial value for uncontrolled widgets.
placeholder#
Text to display in the input when the value is empty.
popupComponent#
BasePopup
popupTransition#
A Transition
component from react-transition-group. The
provided component will be used instead of the default SlideDownTransition
for
fully customizable animations. The transition component is also injected with a
dropUp
prop indicating the direction it should open.
readOnly#
Controls the read-only state of the Combobox.
renderListGroup#
Customize the rendering of the group headings when groupBy
is active.
renderListItem#
Customize the rendering of each Combobox list item.
selectIcon#
Specify the element used to render the select (down arrow) icon.
caretDown
textField#
A property name, or accessor function, that provides the text content of the data
items. The Combobox will filter data based on this value as well as use it as the
default display value for list items and selected values.
value#
Controls the current value of the Combobox.