Multi select

A dropdown for picking any number of values from a list, shown in the field as text or as removable chips. The value is an array in selection order.

  • vig-multi-select
  • ng-template[vigSelectOption]
Import
import { MultiSelect } from '@vigdx/ui/multi-select';
import { SelectOptionTemplate } from '@vigdx/ui/select';

Basic

Pass 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.

Skills

Skills (summary)

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.

Skills

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.

Markets

Translated labels

Every text the field adds can be set per instance: selectedItemsLabel ( {0} is the count), selectAllLabel , filterPlaceholder , filterAriaLabel , emptyMessage , clearAriaLabel and removeAriaLabel (the option label is appended; chipRemoveAriaLabel is its deprecated name).

Pazarlar

Pazarlar

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.

Skills

Shown on your public profile.

Skills

Pick at least one skill.

Disabled

Read-only

Small

Medium

Large

Reactive Forms

Import VigValueAccessor next to the component to use formControlName , [formControl] or ngModel . Type the control as an array; Validators.required treats [] as missing.

Skills

Markets

{
  "skills": [],
  "markets": [
    "de"
  ]
}

Signal Forms

vig-multi-select implements FormValueControl<T[]> . Signal Forms' required() treats [] as filled, so check the length with validate() .

Skills

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"]

MultiSelect styling hooks
Part Element data-state
field Positioned wrapper of the label, trigger and buttons. —
label The visible (or floating) label. —
trigger The role="combobox" element. open, closed
value The comma list or "{0} selected" summary. —
chip A vig-chip per selected option ( display="chip" ). —
placeholder The placeholder text in the trigger. —
indicator The chevron. —
clear The clear button ( clearable ). —
panel The overlay panel, rendered in the overlay container. —
listbox The role="listbox" list inside the panel. —
option One option ( aria-selected , aria-disabled ). —
empty The "no results" row. —
filter The search field at the top of the panel ( filter ). —
select-all The select-all toggle ( showSelectAll ). —
hint The vig-hint (a display: contents host; style its text part). —
disabled-reason The vig-hint with the disabled reason ( display: contents ). —
error The vig-field-error (a display: contents host; style its message part). —

Accessibility

  • The field is a role="combobox" controlling a role="listbox" with aria-multiselectable="true"; each option reports its state with aria-selected.
  • Focus stays on the field and the highlighted option is exposed through aria-activedescendant and drawn with an outline that forced-colors mode keeps. With filter, the trigger opens a labelled role="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 with aria-pressed.
  • The field is named by its label, also with hideLabel; hint and error are linked through aria-describedby and an invalid field sets aria-invalid="true".

API

MultiSelect

vig-multi-select component
MultiSelect props
Name Type Default Description
ariaLabelstring | undefinedundefined
—
chipRemoveAriaLabelstring | undefinedundefined

Deprecated: Use `removeAriaLabel`; still honored when `removeAriaLabel` is unset.

—
clearablebooleanfalse
—
clearAriaLabelstring | undefinedundefined
—
dirtybooleanfalse
—
disabledbooleanfalse
—
disabledReasonsreadonly WithOptionalFieldTree<DisabledReason>[][]
—
display"comma" | "chip"'comma'

'comma' joins the labels; 'chip' renders removable chips.

emptyMessagestring | undefinedundefined
—
errorMessagesRecord<string, string>—
—
errorsreadonly ValidationError.WithOptionalFieldTree[][]
—
filterbooleanfalse
—
filterAriaLabelstring | undefinedundefined
—
filterPlaceholderstring | undefinedundefined
—
hiddenbooleanfalse
—
hideLabelbooleanfalse

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.

hintstring | undefinedundefined
—
invalidbooleanfalse
—
label required string—
—
labelPositionLabelPosition'float'

float (default) rests the label inside the field; top sets it above a shorter field, for forms laid out with labels over their controls.

maxSelectedLabelsnumber3

Above this count the trigger shows selectedItemsLabel instead.

namestring''
—
optionsreadonly SelectOption<T>[][]
—
pendingbooleanfalse
—
placeholderstring | undefinedundefined
—
readonlybooleanfalse
—
removeAriaLabelstring | undefinedundefined

Prefix for each chip's remove button name (i18n); the option label is appended.

requiredbooleanfalse
—
selectAllLabelstring | undefinedundefined
—
selectedItemsLabelstring | undefinedundefined

{0} is replaced with the selection count.

showSelectAllbooleanfalse
—
sizeFieldSize'md'
—
touchedbooleanfalse
—
value model T[][]
—

SelectOptionTemplate

ng-template[vigSelectOption] directive

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.

Example :
<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>
SelectOptionTemplate props
Name Type Default Description
vigSelectOptionOfreadonly SelectOption<T>[] | null | undefinedundefined

Type-only: the options the template renders, so the template type checker infers the option value type. Not read at runtime.

VigValueAccessor

directive

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.

VigValueAccessor methods
Signature Description
registerOnChange(fn: (value: unknown) => void): void
—
registerOnTouched(fn: () => void): void
—
setDisabledState(disabled: boolean): void
—
writeValue(value: unknown): void
—

Are you sure?