Multi select
vig-multi-select ng-template[vigSelectOption]
import { MultiSelect } from '@vigdx/ui/multi-select';
import { SelectOptionTemplate } from '@vigdx/ui/select';Basic
options as SelectOption objects and bind [(value)] to an array; empty is [] . The list stays open while you pick. Past maxSelectedLabels (3 by default) the field shows a count such as 3 selected instead of the labels.
Value: angular, typescript
Chips
display="chip" shows each selection as a chip with its own remove button. Long chips truncate instead of widening the field.
Filter, select all and clear
filter adds a search box, showSelectAll a row that selects or clears every visible option (only the filtered ones while a filter is typed), and clearable a button that empties the value.
Translated labels
selectedItemsLabel ( {0} is the count), selectAllLabel , filterPlaceholder , filterAriaLabel , emptyMessage , clearAriaLabel and removeAriaLabel (the option label is appended; chipRemoveAriaLabel is its deprecated name).
Label, hint, error, states and sizes
labelPosition="top" puts the label above the field and hideLabel hides it for toolbars. Errors show once the field is touched and invalid . readonly keeps the field focusable but does not open the list.
Shown on your public profile.
Reactive Forms
VigValueAccessor next to the component to use formControlName , [formControl] or ngModel . Type the control as an array; Validators.required treats [] as missing.
Signal Forms
vig-multi-select implements FormValueControl<T[]> . Signal Forms' required() treats [] as filled, so check the length with validate() .
Pick two to four.
Valid: no · 1 selected
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="multi-select"][data-part="field"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="multi-select"]
| Part | Element | data-state |
|---|---|---|
field | — | |
label | — | |
trigger | role="combobox" element. | open, closed |
value | — | |
chip | vig-chip per selected option ( display="chip" ). | — |
placeholder | — | |
indicator | — | |
clear | clearable ). | — |
panel | — | |
listbox | role="listbox" list inside the panel. | — |
option | aria-selected , aria-disabled ). | — |
empty | — | |
filter | filter ). | — |
select-all | showSelectAll ). | — |
hint | vig-hint (a display: contents host; style its text part). | — |
disabled-reason | vig-hint with the disabled reason ( display: contents ). | — |
error | vig-field-error (a display: contents host; style its message part). | — |
Accessibility
- The field is a
role="combobox"controlling arole="listbox"witharia-multiselectable="true"; each option reports its state witharia-selected. - Focus stays on the field and the highlighted option is exposed through
aria-activedescendantand drawn with an outline that forced-colors mode keeps. Withfilter, the trigger opens a labelledrole="dialog"(aria-haspopup="dialog") holding the filter box, itself a combobox (aria-autocomplete="list") driving the list. The arrows, Home and End move; Enter or Space toggle the option; Escape closes; typing jumps to a matching label. - Chip remove buttons are named "Remove" plus the option label by default (
removeAriaLabel); the select-all row is a button witharia-pressed. - The field is named by its
label, also withhideLabel; hint and error are linked througharia-describedbyand an invalid field setsaria-invalid="true".
API
MultiSelect
vig-multi-select| Name | Type | Default | Description |
|---|---|---|---|
ariaLabel | string | undefined | undefined | — |
chipRemoveAriaLabel | string | undefined | undefined | Deprecated: Use `removeAriaLabel`; still honored when `removeAriaLabel` is unset. — |
clearable | boolean | false | — |
clearAriaLabel | string | undefined | undefined | — |
dirty | boolean | false | — |
disabled | boolean | false | — |
disabledReasons | readonly WithOptionalFieldTree<DisabledReason>[] | [] | — |
display | "comma" | "chip" | 'comma' | 'comma' joins the labels; 'chip' renders removable chips. |
emptyMessage | string | undefined | undefined | — |
errorMessages | Record<string, string> | — | — |
errors | readonly ValidationError.WithOptionalFieldTree[] | [] | — |
filter | boolean | false | — |
filterAriaLabel | string | undefined | undefined | — |
filterPlaceholder | string | undefined | undefined | — |
hidden | boolean | false | — |
hideLabel | boolean | false | Visually hides the label — it still names the control for assistive tech — and drops the row reserved for it, giving a shorter control for dense toolbars such as table filters. Pair it with a placeholder. |
hint | string | undefined | undefined | — |
invalid | boolean | false | — |
label | string | — | — |
labelPosition | LabelPosition | 'float' |
|
maxSelectedLabels | number | 3 | Above this count the trigger shows |
name | string | '' | — |
options | readonly SelectOption<T>[] | [] | — |
pending | boolean | false | — |
placeholder | string | undefined | undefined | — |
readonly | boolean | false | — |
removeAriaLabel | string | undefined | undefined | Prefix for each chip's remove button name (i18n); the option label is appended. |
required | boolean | false | — |
selectAllLabel | string | undefined | undefined | — |
selectedItemsLabel | string | undefined | undefined |
|
showSelectAll | boolean | false | — |
size | FieldSize | 'md' | — |
touched | boolean | false | — |
value | T[] | [] | — |
| Name | Payload | Description |
|---|---|---|
touch | void | — |
valueChange | T[] | — |
| Signature | Description |
|---|---|
focus(options?: FocusOptions): void | Moves focus to the control's interactive element (the input, or the
trigger of a popup control). Signal Forms calls it through
|
isSelected(value: T): boolean | — |
reset(): void | Closes the panel without moving focus or marking the field touched; see |
SelectOptionTemplate
ng-template[vigSelectOption]Custom rendering for options of vig-select, vig-multi-select,
vig-listbox and vig-select-button, replacing the default icon + label. vig-select also
uses it for the selected value shown in the trigger.
Bind the same options to vigSelectOptionOf (like ngForOf) to type
let-option in the template; without it the option value is unknown.
<vig-select label="Status" [options]="statuses">
<ng-template vigSelectOption [vigSelectOptionOf]="statuses" let-option>
<i [class]="option.value" aria-hidden="true"></i> {{ option.label }}
</ng-template>
</vig-select>| Name | Type | Default | Description |
|---|---|---|---|
vigSelectOptionOf | readonly SelectOption<T>[] | null | undefined | undefined | Type-only: the options the template renders, so the template type checker infers the option value type. Not read at runtime. |
VigValueAccessor
Bridges the vigdx form fields to Reactive Forms (formControl,
formControlName) and template-driven forms (ngModel). Import it next to
the component; Signal Forms ([formField]) need no accessor.
| Signature | Description |
|---|---|
registerOnChange(fn: (value: unknown) => void): void | — |
registerOnTouched(fn: () => void): void | — |
setDisabledState(disabled: boolean): void | — |
writeValue(value: unknown): void | — |