AutocompleteMulti
A multi-select autocomplete component that allows users to select multiple items from suggestions.
Basic Usage
Basic Multi-Select Autocomplete
Select multiple items with autocomplete functionality
Preset Values
With Preset Values
Autocomplete with pre-selected values
Limited Selections
Limited Selections
Maximum 3 selections allowed
Disabled State
Disabled State
AutocompleteMulti in disabled state
Usage
Basic Usage
import { AutocompleteMulti } from 'fluxo-ui';
const items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Cherry', value: 'cherry' },
{ label: 'Date', value: 'date' },
];
function MyComponent() {
const [value, setValue] = useState([]);
return (
<AutocompleteMulti
items={items}
value={value}
placeholder="Select multiple items..."
onChange={(e) => setValue(e.value)}
/>
);
}Advanced Usage
import { AutocompleteMulti } from 'fluxo-ui';
function MyComponent() {
const [value, setValue] = useState(['apple']);
const [items, setItems] = useState([
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Cherry', value: 'cherry' },
]);
const handleFilter = (query) => {
const filtered = items.filter(item =>
item.label.toLowerCase().includes(query.toLowerCase())
);
setItems(filtered);
};
return (
<AutocompleteMulti
items={items}
value={value}
placeholder="Max 3 selections..."
maxSelectedItems={3}
minLength={2}
onChange={(e) => setValue(e.value)}
onFilter={handleFilter}
showCount
/>
);
}Import
import { AutocompleteMulti } from 'fluxo-ui';Props
itemsreqListItem[]Array of items to display in suggestions
itemsreqListItem[]Array of items to display in suggestions
valueT[]Array of selected values
valueT[]Array of selected values
onChangefunctionCallback fired when values change: (event: ComponentEvent<T[]>) => void
onChangefunctionCallback fired when values change: (event: ComponentEvent<T[]>) => void
onFilterfunctionCallback fired when filter input changes: (query: string) => void | Promise<void>
onFilterfunctionCallback fired when filter input changes: (query: string) => void | Promise<void>
placeholderstring"Type to search and select..."Placeholder text for the input field
placeholderstring"Type to search and select..."Placeholder text for the input field
disabledbooleanfalseWhether the input is disabled
disabledbooleanfalseWhether the input is disabled
readonlybooleanfalseWhether the input is readonly
readonlybooleanfalseWhether the input is readonly
requiredbooleanfalseWhether the field is required
requiredbooleanfalseWhether the field is required
debounceMsnumber300Debounce delay in milliseconds for filter callback
debounceMsnumber300Debounce delay in milliseconds for filter callback
minLengthnumber1Minimum characters before showing suggestions
minLengthnumber1Minimum characters before showing suggestions
maxSelectedItemsnumberMaximum number of items that can be selected
maxSelectedItemsnumberMaximum number of items that can be selected
loadingbooleanfalseWhether data is loading
loadingbooleanfalseWhether data is loading
emptyMessagestring"No results found"Message shown when no items match the filter
emptyMessagestring"No results found"Message shown when no items match the filter
renderItemfunctionCustom render function for each item: (item: ListItem, index: number, isSelected: boolean, isHighlighted: boolean) => React.ReactNode
renderItemfunctionCustom render function for each item: (item: ListItem, index: number, isSelected: boolean, isHighlighted: boolean) => React.ReactNode
renderSelectedTemplatefunctionCustom render function for selected items: (selectedItems: ListItem[], onRemove: (value: T) => void) => React.ReactNode
renderSelectedTemplatefunctionCustom render function for selected items: (selectedItems: ListItem[], onRemove: (value: T) => void) => React.ReactNode
showCountbooleanfalseShow count of selected items when more than 3 are selected
showCountbooleanfalseShow count of selected items when more than 3 are selected
autoFocusbooleanfalseAuto-focus the input field on mount
autoFocusbooleanfalseAuto-focus the input field on mount
idstringID for the input element
idstringID for the input element
namestringName attribute for the hidden input field
namestringName attribute for the hidden input field
argsanyAdditional arguments passed to event callbacks
argsanyAdditional arguments passed to event callbacks
Features
Multi-Selection via Autocomplete
Type to filter and select multiple items that appear as removable tags inline with the input
Tag Display
Each selected item renders as a dismissible tag inside the input for a compact, clear selection view
Selection Limit
maxSelectedItems prevents selecting beyond the configured cap, locking the input automatically
Show Count Mode
When showCount is enabled, overflowing tags collapse into a numeric badge for cleaner display
Async Filtering
onFilter with built-in debounce supports server-side search and live data loading as the user types
Custom Item Renderer
renderItem and renderSelectedTemplate props allow fully custom suggestion and tag layouts
Accessibility
ARIA combobox and listbox roles with keyboard navigation, focus trapping, and screen reader announcements
Theming
Full dark/light and 5 brand themes supported via CSS variables with zero extra configuration