Skip to content

Select

<ax-select> is a single-value listbox with the same field chrome as Input (inputVariants) and a token-styled overlay panel (rounded corners, border, shadow — matching Combobox). Native <select> popups cannot follow the design system, so Select uses a custom trigger + CDK panel instead.

For type-to-filter, multi-select, or async options, use Combobox.

import { AxSelectComponent, type AxSelectOption } from '@axisui-ng/forms';
<ax-select
[(value)]="country"
[options]="[
{ label: 'United States', value: 'us' },
{ label: 'India', value: 'in' },
{ label: 'Germany', value: 'de' },
]"
placeholder="Select a country"
/>
<ax-form-field label="Country" forId="country">
<ax-select id="country" [(value)]="country" [options]="countries" />
</ax-form-field>
OptionValuesDefaultNotes
size'sm' | 'md' | 'lg''md'Control height via shared inputVariants.
<ax-select size="sm" [options]="options" placeholder="Small" />
<ax-select size="md" [options]="options" placeholder="Medium" />
<ax-select size="lg" [options]="options" placeholder="Large" />
InputTypeDefaultNotes
valuemodel<string | null>nullSelected option value ([(value)]); also CVA.
optionsAxSelectOption[] (required){ value: string; label: string; disabled?: boolean }[].
idstring | nullnullTrigger button id — match a FormField forId.
size'sm' | 'md' | 'lg''md'Trigger height.
placeholderstring''Shown when nothing is selected.
requiredbooleanfalseSets aria-required.
disabledbooleanfalseDisabled (also via CVA setDisabledState).
invalidbooleanfalseError styling + aria-invalid (OR’d with FormField wiring).
ariaLabelstring | nullnullAccessible label when there’s no FormField label.
describedBystring | nullnullaria-describedby; explicit value wins over FormField auto-wiring.

Trigger is role="combobox" with aria-haspopup="listbox", aria-expanded, and aria-activedescendant while open. Keyboard: ArrowDown/Up/Enter/Space open and navigate; Enter/Space select; Escape closes. Provide a label via FormField forId + id, or ariaLabel. Inside a FormField, aria-describedby / aria-invalid are auto-wired unless overridden.

Interactive examples live in Storybook under Forms / Select. Run pnpm storybook to explore them.