Capítulo 19 de 51
A filterable Select — selection is restricted to predefined items (like Select), but the popup filters as you type; use it over Select when the item list is large enough to need filtering, and prefer Autocomplete instead when free-form text input must be allowed.
Root → Label + InputGroup (Input, Trigger, Icon, Clear, Value, Chips → Chip → ChipRemove) + Portal → Backdrop, Positioner → Popup (Arrow, Status, Empty, List → Row → Item → ItemIndicator, Separator, Group → GroupLabel, Collection).Combobox.Input with a native <label>/Field.Label; input-inside-popup pattern → Combobox.Label labels the Trigger instead, since the trigger (not the input) is the form control in that layout.multiple prop + the Chips/Chip/ChipRemove parts render selected items as removable chips inside the input group — a feature Select doesn't have.defaultValue/value passed to Root; the items array's element type must match Item's value type.filter/filteredItems/useFilter/useFilteredItems machinery as Autocomplete (ch013); isItemEqualToValue customizes equality when items aren't primitives; itemToStringLabel/itemToStringValue control display vs. value string conversion.autoComplete: browser autofill hint prop, separate from the component's own filtering.| Part | Notable props | Notable data attributes |
|---|---|---|
Root | value/onValueChange, inputValue/onInputValueChange, open/onOpenChange, multiple, items, filter, isItemEqualToValue, itemToStringLabel/itemToStringValue, grid, virtualized, limit | — |
Item | value, onClick, index, disabled | data-selected, data-highlighted, data-disabled |
ItemIndicator | keepMounted | data-starting-style/data-ending-style |
Chips/Chip/ChipRemove | nativeButton (on ChipRemove) | — |
Value | placeholder | — |
Trigger | nativeButton, disabled | data-placeholder, data-popup-open, plus shared field-state attributes |
Input; if the input lives inside the popup and the visible control is the trigger, label the Trigger via Combobox.Label instead — mislabeling here is the most common Combobox a11y bug.Label placement).