The MultiSelect component allows users to select multiple options from a dropdown list with support for search, chips display, and select all functionality.
Basic usage
<flx-multiselect
label="Tags"
placeholder="Select tags"
[(ngModel)]="selectedTags"
[options]="tags">
</flx-multiselect>
Properties
Label text displayed above the multiselect
Placeholder text when no options are selected
Array of currently selected values
Array of options to display
Marks the field as required
error
boolean | string
default:"false"
Shows error state
Enables search/filter functionality
Shows “Select All” option
Maximum number of options that can be selected
displayMode
'chips' | 'count' | 'text'
default:"chips"
How selected values are displayed
Events
Emitted when selected values change
Emitted when user types in search box
Examples
Basic multiselect
With max selections
Display modes
With select all
Reactive forms
Async options
<flx-multiselect
label="Skills"
placeholder="Select your skills"
[(ngModel)]="selectedSkills"
[options]="skills">
</flx-multiselect>
export class SkillsSelect {
selectedSkills = ['js', 'angular'];
skills = [
{ value: 'js', label: 'JavaScript' },
{ value: 'ts', label: 'TypeScript' },
{ value: 'angular', label: 'Angular' },
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' }
];
}
<flx-multiselect
label="Top 3 priorities"
placeholder="Select up to 3 priorities"
[(ngModel)]="priorities"
[options]="priorityOptions"
[maxSelections]="3">
</flx-multiselect>
When maxSelections is reached, remaining options become disabled.
<!-- Chips mode (default) -->
<flx-multiselect
label="Tags"
[(ngModel)]="tags"
[options]="tagOptions"
displayMode="chips">
</flx-multiselect>
<!-- Count mode -->
<flx-multiselect
label="Categories"
[(ngModel)]="categories"
[options]="categoryOptions"
displayMode="count">
</flx-multiselect>
<!-- Text mode -->
<flx-multiselect
label="Locations"
[(ngModel)]="locations"
[options]="locationOptions"
displayMode="text">
</flx-multiselect>
Use chips for few selections, count for many selections, and text for compact display.
<flx-multiselect
label="Permissions"
placeholder="Select permissions"
[(ngModel)]="permissions"
[options]="permissionOptions"
[selectAll]="true">
</flx-multiselect>
export class PermissionsForm {
permissions: string[] = [];
permissionOptions = [
{ value: 'read', label: 'Read' },
{ value: 'write', label: 'Write' },
{ value: 'delete', label: 'Delete' },
{ value: 'admin', label: 'Admin' }
];
}
<form [formGroup]="filterForm">
<flx-multiselect
label="Filters"
formControlName="categories"
[options]="categoryOptions"
[error]="categoriesControl.invalid && categoriesControl.touched">
</flx-multiselect>
</form>
import { FormBuilder, Validators } from '@angular/forms';
export class FilterForm {
filterForm = this.fb.group({
categories: [[], [Validators.required, Validators.minLength(1)]]
});
categoryOptions = [
{ value: 'tech', label: 'Technology' },
{ value: 'business', label: 'Business' },
{ value: 'design', label: 'Design' },
{ value: 'marketing', label: 'Marketing' }
];
get categoriesControl() { return this.filterForm.get('categories')!; }
constructor(private fb: FormBuilder) {}
}
<flx-multiselect
label="Team members"
placeholder="Search and select members"
[(ngModel)]="selectedMembers"
[options]="members"
[loading]="isLoading"
[searchable]="true"
(search)="searchMembers($event)">
</flx-multiselect>
import { Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
export class TeamSelect implements OnInit {
selectedMembers: string[] = [];
members: SelectOption[] = [];
isLoading = false;
private searchSubject = new Subject<string>();
ngOnInit() {
this.searchSubject.pipe(debounceTime(300)).subscribe(query => {
this.loadMembers(query);
});
this.loadMembers('');
}
searchMembers(query: string) {
this.searchSubject.next(query);
}
async loadMembers(query: string) {
this.isLoading = true;
const results = await this.teamService.searchMembers(query);
this.members = results.map(m => ({
value: m.id,
label: m.name
}));
this.isLoading = false;
}
}
Styling
flx-multiselect {
--flx-multiselect-min-height: 40px;
--flx-multiselect-border-radius: 4px;
--flx-multiselect-border-color: #d1d5db;
--flx-multiselect-focus-border-color: #3b82f6;
--flx-multiselect-chip-background: #dbeafe;
--flx-multiselect-chip-color: #1e40af;
--flx-multiselect-chip-remove-hover: #ef4444;
--flx-multiselect-dropdown-max-height: 300px;
}
Accessibility
The MultiSelect component provides full accessibility support:
- Keyboard navigation (Arrow keys, Enter, Space, Escape)
role="combobox" with aria-multiselectable="true"
- Chip removal with keyboard (Backspace)
- Screen reader announcements for selections
- Focus management
Best practices
- Use clear, descriptive option labels
- Enable search for lists with more than 10 options
- Set
maxSelections when there’s a practical limit
- Use appropriate
displayMode based on typical selection count
- Provide helper text to explain selection limits
- Consider grouping options by category for large lists
- Select - Single option selection
- Checkbox - Alternative for few options