# SbMultiSelect A dropdown component for selecting multiple values from a list. Selected items are displayed as removable chips. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Values | IReadOnlyList\? | null | Selected values (two-way bindable) | | ValuesChanged | EventCallback\\> | - | Callback when selection changes | | Items | IEnumerable\? | null | Items to select from | | TextField | Func\ | item => item.ToString() | Function to get display text from item | | ValueField | Func\ | item => (TValue)item | Function to get value from item | | Placeholder | string? | null | Placeholder when no selection (when null, uses localized default) | | SearchPlaceholder | string? | null | Placeholder for search input (when null, uses localized default) | | NoResultsText | string? | null | Text when search returns no results (when null, uses localized default) | | RemoveAriaLabel | string? | null | Aria label for chip remove button (when null, uses localized default) | | Searchable | bool | false | Whether the select is searchable | | MaxSelected | int? | null | Maximum number of selections (optional cap) | | Disabled | bool | false | Whether the select is disabled | | Id | string? | null | Element ID for form association | | Label | string? | null | Label text displayed above the select | | Required | bool | false | Whether the field is required | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | ## Events | Event | Type | Description | |-------|------|-------------| | ValuesChanged | EventCallback\\> | Fired when the selection changes | ## Templates / Slots (RenderFragments) | Slot | Type | Description | |------|------|-------------| | ItemTemplate | RenderFragment\ | Custom template for dropdown items | | ChipTemplate | RenderFragment\ | Custom template for selected chips | | NoResultsTemplate | RenderFragment | Template shown when search returns no results | ### Template Usage Examples #### Custom ItemTemplate ```razor @tag.Name ``` #### NoResultsTemplate ```razor No users match your search ``` ## CSS Classes - `sb-select-anchor` - Shared anchor container - `sb-multi-select-anchor` - Multi-select wrapper (used with sb-select-anchor) - `sb-multi-select__label` - Label element - `sb-multi-select__required` - Required asterisk - `sb-multi-select-trigger` - Trigger container - `sb-multi-select__chip` - Selected item chip - `sb-multi-select__chip-remove` - Chip remove button - `sb-multi-select__placeholder` - Placeholder text - `sb-multi-select--disabled` - Disabled state - `sb-select-dropdown` - Dropdown panel - `sb-select-dropdown--flip-up` - Dropdown flips upward - `sb-select-search` - Search input container - `sb-select-options` - Options container - `sb-select-option` - Individual option - `sb-select-option--selected` - Selected option - `sb-select-empty` - Empty state ## Accessibility - Uses `role="listbox"` with `aria-multiselectable="true"` - `role="option"` for each item - `aria-selected` indicates selection state - Chip remove buttons have aria-labels - Keyboard: Enter/Space to toggle selection, Escape to close ## Examples ### Basic Usage ```razor ``` ### With Objects ```razor ``` ### Searchable with Limit ```razor ``` ### Required Field ```razor ``` ### Disabled State ```razor ```