# Select

A dropdown for picking one value from a list. Use it when there are too many options to show as radios, or when space is tight; add a filter for long lists.

- Package: [@vigdx/ui](https://www.npmjs.com/package/@vigdx/ui)
- Selectors: `vig-select`, `ng-template[vigSelectOption]`
- Source: [libs/ui/src/lib/molecules/select/select.ts](https://github.com/bakyurekk/vigdx/blob/main/libs/ui/src/lib/molecules/select/select.ts)

```typescript title="Import"
import { Select, SelectOptionTemplate } from '@vigdx/ui/select';
```

## Basic

Pass `options` as `SelectOption` objects (`value`, `label`, optional `icon` and `disabled`) and bind `[(value)]`. Values can be strings, numbers or any other primitive and are compared with `===`; the value is `null` while nothing is selected.

```typescript title="select-basic.ts"
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { Select, type SelectOption } from '@vigdx/ui/select';

import { COUNTRIES } from './options';

@Component({
  selector: 'app-select-basic',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [Select],
  template: `
    <div class="grid gap-4 sm:grid-cols-2">
      <vig-select
        label="Country"
        placeholder="Select a country"
        [options]="countries"
        [(value)]="country"
      />
      <vig-select label="Page size" [options]="pageSizes" [(value)]="pageSize" />
    </div>
    <p class="text-sm text-muted-foreground">
      Country: {{ country() ?? 'none' }} · Page size: {{ pageSize() }}
    </p>
  `,
})
export class SelectBasicDemo {
  protected readonly countries = COUNTRIES;
  protected readonly country = signal<string | null>(null);

  // Values can be any primitive; they are compared with ===.
  protected readonly pageSizes: SelectOption<number>[] = [
    { value: 10, label: '10 rows' },
    { value: 25, label: '25 rows' },
    { value: 50, label: '50 rows' },
  ];
  protected readonly pageSize = signal<number | null>(25);
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Icons and disabled options

`icon` names a registered icon shown before the label, in the list and in the field. An option with `disabled: true` stays visible but cannot be chosen and is skipped by the arrow keys.

```typescript title="select-icons.ts"
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Select } from '@vigdx/ui/select';

import { STATUSES } from './options';

@Component({
  selector: 'app-select-icons',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [Select],
  template: `
    <div class="max-w-xs">
      <vig-select label="Status" value="pending" [options]="statuses" />
    </div>
  `,
})
export class SelectIconsDemo {
  protected readonly statuses = STATUSES;
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Filter and clear

`filter` adds a search box at the top of the list; `clearable` adds a button that sets the value back to `null`. `filterPlaceholder`, `filterAriaLabel`, `emptyMessage` and `clearAriaLabel` translate the texts per instance.

```typescript title="select-filter.ts"
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Select } from '@vigdx/ui/select';

import { COUNTRIES } from './options';

@Component({
  selector: 'app-select-filter',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [Select],
  template: `
    <div class="grid gap-4 sm:grid-cols-2">
      <vig-select
        label="Country"
        placeholder="Select a country"
        [options]="countries"
        [filter]="true"
        [clearable]="true"
      />
      <vig-select
        label="Ülke"
        placeholder="Bir ülke seçin"
        value="tr"
        filterPlaceholder="Ülke ara…"
        filterAriaLabel="Ülkeleri filtrele"
        emptyMessage="Sonuç bulunamadı"
        clearAriaLabel="Seçimi temizle"
        [options]="countries"
        [filter]="true"
        [clearable]="true"
      />
    </div>
  `,
})
export class SelectFilterDemo {
  protected readonly countries = COUNTRIES;
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Custom option template

An `<ng-template vigSelectOption let-option>` inside the select renders each option and the selected value in the field. `option` is the whole `SelectOption`; bind the same list to `[vigSelectOptionOf]` (like `ngForOf`) so its value is typed. Use the template for icon fonts, avatars or colour dots.

```typescript title="select-custom-option.ts"
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Select, SelectOptionTemplate, type SelectOption } from '@vigdx/ui/select';

import type { Status } from './options';

// Colour tokens per status; never literal colours.
const DOT_CLASSES: Record<Status, string> = {
  active: 'bg-success',
  pending: 'bg-warning',
  blocked: 'bg-error',
  archived: 'bg-muted-foreground',
};

@Component({
  selector: 'app-select-custom-option',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [Select, SelectOptionTemplate],
  template: `
    <div class="max-w-xs">
      <vig-select label="Status" value="active" [options]="statuses">
        <ng-template vigSelectOption [vigSelectOptionOf]="statuses" let-option>
          <span
            aria-hidden="true"
            class="size-[0.625em] shrink-0 rounded-full"
            [class]="dot(option.value)"
          ></span>
          <span class="truncate">{{ option.label }}</span>
        </ng-template>
      </vig-select>
    </div>
  `,
})
export class SelectCustomOptionDemo {
  protected readonly statuses: SelectOption<Status>[] = [
    { value: 'active', label: 'Active' },
    { value: 'pending', label: 'Pending' },
    { value: 'blocked', label: 'Blocked' },
    { value: 'archived', label: 'Archived' },
  ];

  // vigSelectOptionOf types option.value as Status.
  protected dot(value: Status): string {
    return DOT_CLASSES[value];
  }
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Label on top and hidden label

`labelPosition="top"` puts the label above the field. In dense toolbars such as table filters, `hideLabel` drops the visible label but keeps it as the accessible name; pair it with a `placeholder`.

```typescript title="select-label-position.ts"
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { InputField } from '@vigdx/ui/input-field';
import { Select } from '@vigdx/ui/select';

import { COUNTRIES, STATUSES } from './options';

@Component({
  selector: 'app-select-label-position',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [InputField, Select],
  template: `
    <div class="grid gap-4 sm:grid-cols-2">
      <vig-select
        label="Billing country"
        labelPosition="top"
        placeholder="Select a country"
        [options]="countries"
      />
      <vig-select
        label="Shipping country"
        labelPosition="top"
        placeholder="Select a country"
        [options]="countries"
      />
    </div>
    <div class="flex flex-wrap gap-2" role="search" aria-label="Filter customers">
      <vig-input class="w-48" label="Search" placeholder="Search…" size="sm" [hideLabel]="true" />
      <vig-select
        class="w-40"
        label="Status"
        placeholder="Any status"
        size="sm"
        [hideLabel]="true"
        [clearable]="true"
        [options]="statuses"
      />
      <vig-select
        class="w-44"
        label="Country"
        placeholder="Any country"
        size="sm"
        [hideLabel]="true"
        [clearable]="true"
        [options]="countries"
      />
    </div>
  `,
})
export class SelectLabelPositionDemo {
  protected readonly countries = COUNTRIES;
  protected readonly statuses = STATUSES;
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Hint, error, states and sizes

`hint` adds help text; errors show once the field is `touched` and `invalid`. `disabled` blocks the field, `readonly` keeps it focusable but does not open the list. `size` is `sm`, `md` (default) or `lg`.

```typescript title="select-states.ts"
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Select } from '@vigdx/ui/select';

import { COUNTRIES } from './options';

@Component({
  selector: 'app-select-states',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [Select],
  template: `
    <div class="grid gap-4 sm:grid-cols-2">
      <vig-select
        label="Country"
        placeholder="Select a country"
        hint="Used for billing and tax."
        [options]="countries"
      />
      <vig-select
        label="Country"
        placeholder="Select a country"
        [options]="countries"
        [required]="true"
        [touched]="true"
        [invalid]="true"
        [errors]="[{ kind: 'required' }]"
        [errorMessages]="{ required: 'Choose the country you are billed in.' }"
      />
      <vig-select label="Disabled" value="fr" [options]="countries" [disabled]="true" />
      <vig-select label="Read-only" value="tr" [options]="countries" [readonly]="true" />
    </div>
    <div class="grid gap-4 sm:grid-cols-3">
      <vig-select label="Small" size="sm" value="de" [options]="countries" />
      <vig-select label="Medium" size="md" value="de" [options]="countries" />
      <vig-select label="Large" size="lg" value="de" [options]="countries" />
    </div>
  `,
})
export class SelectStatesDemo {
  protected readonly countries = COUNTRIES;
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Reactive Forms

Import `VigValueAccessor` next to the component to use `formControlName`, `[formControl]` or `ngModel`. Type the control with the option value type plus `null`.

```typescript title="select-reactive-forms.ts"
import { JsonPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { Button } from '@vigdx/ui/button';
import { VigValueAccessor } from '@vigdx/ui/core';
import { Select } from '@vigdx/ui/select';

import { COUNTRIES, STATUSES, type Status } from './options';

@Component({
  selector: 'app-select-reactive-forms',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [JsonPipe, ReactiveFormsModule, Button, Select, VigValueAccessor],
  template: `
    <form class="flex flex-col gap-4" [formGroup]="form" (ngSubmit)="submit()">
      <div class="grid gap-4 sm:grid-cols-2">
        <vig-select label="Country" formControlName="country" [options]="countries" />
        <vig-select label="Status" formControlName="status" [options]="statuses" />
      </div>
      <div class="flex gap-2">
        <vig-button type="submit" label="Save" />
        <vig-button label="Reset" variant="secondary" (click)="form.reset()" />
      </div>
      <pre class="rounded-input bg-subtle p-3 font-mono text-xs">{{ form.value | json }}</pre>
    </form>
  `,
})
export class SelectReactiveFormsDemo {
  protected readonly countries = COUNTRIES;
  protected readonly statuses = STATUSES;
  protected readonly form = new FormGroup({
    country: new FormControl<string | null>(null, Validators.required),
    status: new FormControl<Status | null>('active', Validators.required),
  });

  protected submit(): void {
    this.form.markAllAsTouched();
  }
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## Signal Forms

`vig-select` implements `FormValueControl<T | null>`. Clearing writes `null`, so type model fields of clearable selects as nullable.

```typescript title="select-signal-forms.ts"
import { JsonPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { FormField, form, required } from '@angular/forms/signals';
import { Select } from '@vigdx/ui/select';

import { COUNTRIES, STATUSES, type Status } from './options';

@Component({
  selector: 'app-select-signal-forms',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [JsonPipe, FormField, Select],
  template: `
    <div class="grid gap-4 sm:grid-cols-2">
      <vig-select
        label="Country"
        placeholder="Select a country"
        [options]="countries"
        [clearable]="true"
        [formField]="account.country"
      />
      <vig-select label="Status" [options]="statuses" [formField]="account.status" />
    </div>
    <pre class="rounded-input bg-subtle p-3 font-mono text-xs">{{ model() | json }}</pre>
  `,
})
export class SelectSignalFormsDemo {
  protected readonly countries = COUNTRIES;
  protected readonly statuses = STATUSES;
  // Clearing sets null, so type fields of clearable selects as nullable.
  protected readonly model = signal<{ country: string | null; status: Status | null }>({
    country: null,
    status: 'active',
  });
  protected readonly account = form(this.model, (path) => {
    required(path.country);
    required(path.status);
  });
}
```

```typescript title="options.ts"
import type { SelectOption } from '@vigdx/ui/select';

export const COUNTRIES: SelectOption[] = [
  { value: 'de', label: 'Germany' },
  { value: 'fr', label: 'France' },
  { value: 'it', label: 'Italy' },
  { value: 'nl', label: 'Netherlands' },
  { value: 'pl', label: 'Poland' },
  { value: 'pt', label: 'Portugal' },
  { value: 'es', label: 'Spain' },
  { value: 'se', label: 'Sweden' },
  { value: 'tr', label: 'Türkiye' },
  { value: 'gb', label: 'United Kingdom' },
  { value: 'us', label: 'United States' },
];

export type Status = 'active' | 'pending' | 'blocked' | 'archived';

// `icon` names a registered glyph (kit built-ins or provideVigdxIcons).
export const STATUSES: SelectOption<Status>[] = [
  { value: 'active', label: 'Active', icon: 'success' },
  { value: 'pending', label: 'Pending', icon: 'warning' },
  { value: 'blocked', label: 'Blocked', icon: 'error' },
  { value: 'archived', label: 'Archived', icon: 'minus', disabled: true },
];
```

## 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="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](https://vigdx.com/docs/theming.md#customizing).

Scope: `[data-scope="select"]`

| Part | Element | data-state |
| --- | --- | --- |
| `field` | Positioned wrapper of the label, trigger and buttons. |   |
| `label` | The visible (or floating) label. |   |
| `trigger` | The `role="combobox"` button. | `open, closed` |
| `value` | The selected option in the trigger. |   |
| `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`). |   |
| `check` | The check mark of the selected option. |   |
| `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

- Follows the APG select-only combobox pattern: the field is a `role="combobox"` with `aria-expanded` and `aria-controls`, the list a `role="listbox"` of `role="option"` items with `aria-selected`.
- Focus stays on the field; 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. ArrowDown, ArrowUp, Enter and Space open the list; the arrows, Home and End move, Enter or Space select, Escape closes and typing jumps to the first matching label.
- The field is named by its `label` (also with `hideLabel`); `ariaLabel` overrides the name. The clear button and filter box have their own translatable labels.
- `required`, `readonly` and an invalid state set `aria-required`, `aria-readonly` and `aria-invalid`; hint and error are linked through `aria-describedby`.
- Icons and custom template content should be decorative; the option `label` is what screen readers announce.

## API

### Select

Selector: `vig-select` · Kind: component

#### Inputs

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `ariaLabel` | `string \| undefined` | `undefined` | — |
| `clearable` | `boolean` | `false` | — |
| `clearAriaLabel` | `string \| undefined` | `undefined` | — |
| `dirty` | `boolean` | `false` | — |
| `disabled` | `boolean` | `false` | — |
| `disabledReasons` | `readonly WithOptionalFieldTree<DisabledReason>[]` | `[]` | — |
| `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` (required) | `string` | — | — |
| `labelPosition` | `LabelPosition` | `'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. |
| `name` | `string` | `''` | — |
| `options` | `readonly SelectOption<T>[]` | `[]` | — |
| `pending` | `boolean` | `false` | — |
| `placeholder` | `string \| undefined` | `undefined` | — |
| `readonly` | `boolean` | `false` | — |
| `required` | `boolean` | `false` | — |
| `size` | `FieldSize` | `'md'` | — |
| `touched` | `boolean` | `false` | — |
| `value` (model) | `T \| null` | `null` | — |

#### Outputs

| Name | Payload | Description |
| --- | --- | --- |
| `touch` | `void` | — |
| `valueChange` | `T \| null` | — |

#### Methods

| 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 `field().focusBoundControl()`; the host element itself cannot take focus. |
| `reset(): void` | Closes the panel without moving focus or marking the field touched; see `VigFormField.reset`. |

### SelectOptionTemplate

Selector: `ng-template[vigSelectOption]` · Kind: 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 :**

```html
<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>
```

#### Inputs

| 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

Kind: 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.

#### Methods

| Signature | Description |
| --- | --- |
| `registerOnChange(fn: (value: unknown) => void): void` | — |
| `registerOnTouched(fn: () => void): void` | — |
| `setDisabledState(disabled: boolean): void` | — |
| `writeValue(value: unknown): void` | — |
