Anatomy
aegov-select renders in one of two ways depending on appearance (and is forced into the second whenever is-multiple is set): a real native <select> built from parsed option data, or a custom trigger button plus an absolutely-positioned dropdown panel. Either way, the actual <aegov-select-option>/<aegov-select-option-group> children you author are never rendered visibly themselves — they're a declarative data source, parsed once into the options that drive whichever UI is showing.

| Item | Name | Description |
|---|---|---|
1 |
Trigger | The native <select>, or the custom button showing the current value/placeholder (listbox appearance) |
2 |
Dropdown panel (listbox only) | The positioned list of options, opening above or below depending on available space |
3 |
Search input (optional, listbox only) | Filters the option list as the user types |
4 |
Option | One selectable choice — declared as aegov-select-option, real either as an <option> or a <div role="option"> |
5 |
Group header (optional) | A non-interactive label above a set of related options, from aegov-select-option-group |
6 |
Clear button (optional, listbox only) | Resets the selection, shown only once something is selected |
7 |
Hint / error message | Supporting helper text; once is-invalid is set, the error message appears above it and the hint stays visible |
Basics
The default appearance="default" renders a real native <select> — the right choice whenever you don't need search or multi-select, since it's the lightest option and gives the best experience on mobile (the OS renders its own picker). Declare each choice as an aegov-select-option child. Always give the select a visible label — every example on this page wraps it in aegov-form-field with an aegov-label.
<aegov-form-field>
<aegov-label>Ministry</aegov-label>
<aegov-select field-id="select-basics" name="ministry" placeholder="Select a ministry">
<aegov-select-option value="moi">Ministry of Interior</aegov-select-option>
<aegov-select-option value="mof">Ministry of Finance</aegov-select-option>
<aegov-select-option value="moh">Ministry of Health and Prevention</aegov-select-option>
<aegov-select-option value="moe">Ministry of Education</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectBasics() {
return (
<AegovFormField>
<AegovLabel>Ministry</AegovLabel>
<AegovSelect fieldId="select-basics" name="ministry" placeholder="Select a ministry">
<AegovSelectOption value="moi">Ministry of Interior</AegovSelectOption>
<AegovSelectOption value="mof">Ministry of Finance</AegovSelectOption>
<AegovSelectOption value="moh">Ministry of Health and Prevention</AegovSelectOption>
<AegovSelectOption value="moe">Ministry of Education</AegovSelectOption>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Ministry</aegov-label>
<aegov-select field-id="select-basics" name="ministry" placeholder="Select a ministry">
<aegov-select-option value="moi">Ministry of Interior</aegov-select-option>
<aegov-select-option value="mof">Ministry of Finance</aegov-select-option>
<aegov-select-option value="moh">Ministry of Health and Prevention</aegov-select-option>
<aegov-select-option value="moe">Ministry of Education</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-basics',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Ministry</aegov-label>
<aegov-select field-id="select-basics" name="ministry" placeholder="Select a ministry">
<aegov-select-option value="moi">Ministry of Interior</aegov-select-option>
<aegov-select-option value="mof">Ministry of Finance</aegov-select-option>
<aegov-select-option value="moh">Ministry of Health and Prevention</aegov-select-option>
<aegov-select-option value="moe">Ministry of Education</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectBasicsComponent {}
Listbox appearance
Set appearance="listbox" for a styled custom dropdown — use it when you need search, multi-selection, grouped options, or a clear button, none of which a native <select> supports. The panel is anchored to the trigger and automatically opens above or below depending on the available viewport space.
<aegov-form-field>
<aegov-label>Service category</aegov-label>
<aegov-select field-id="select-listbox" name="service-category" appearance="listbox" placeholder="Select a service category">
<aegov-select-option value="passport">Passport & travel documents</aegov-select-option>
<aegov-select-option value="visa">Visa & residency</aegov-select-option>
<aegov-select-option value="vehicle">Vehicle registration</aegov-select-option>
<aegov-select-option value="health">Health insurance</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectListbox() {
return (
<AegovFormField>
<AegovLabel>Service category</AegovLabel>
<AegovSelect fieldId="select-listbox" name="service-category" appearance="listbox" placeholder="Select a service category">
<AegovSelectOption value="passport">Passport & travel documents</AegovSelectOption>
<AegovSelectOption value="visa">Visa & residency</AegovSelectOption>
<AegovSelectOption value="vehicle">Vehicle registration</AegovSelectOption>
<AegovSelectOption value="health">Health insurance</AegovSelectOption>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Service category</aegov-label>
<aegov-select field-id="select-listbox" name="service-category" appearance="listbox" placeholder="Select a service category">
<aegov-select-option value="passport">Passport & travel documents</aegov-select-option>
<aegov-select-option value="visa">Visa & residency</aegov-select-option>
<aegov-select-option value="vehicle">Vehicle registration</aegov-select-option>
<aegov-select-option value="health">Health insurance</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-listbox',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Service category</aegov-label>
<aegov-select field-id="select-listbox" name="service-category" appearance="listbox" placeholder="Select a service category">
<aegov-select-option value="passport">Passport & travel documents</aegov-select-option>
<aegov-select-option value="visa">Visa & residency</aegov-select-option>
<aegov-select-option value="vehicle">Vehicle registration</aegov-select-option>
<aegov-select-option value="health">Health insurance</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectListboxComponent {}
Grouped options
Wrap related options in aegov-select-option-group with a label. The group label renders as a non-interactive header above its members, in both appearances.
<aegov-form-field>
<aegov-label>Emirate</aegov-label>
<aegov-select field-id="select-grouped" name="emirate-grouped" appearance="listbox" placeholder="Select an emirate">
<aegov-select-option-group label="Federal capital">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select-option-group>
<aegov-select-option-group label="Northern Emirates">
<aegov-select-option value="dxb">Dubai</aegov-select-option>
<aegov-select-option value="shj">Sharjah</aegov-select-option>
<aegov-select-option value="ajm">Ajman</aegov-select-option>
</aegov-select-option-group>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption, AegovSelectOptionGroup } from '@aegov/designsystem-react';
export default function SelectGrouped() {
return (
<AegovFormField>
<AegovLabel>Emirate</AegovLabel>
<AegovSelect fieldId="select-grouped" name="emirate-grouped" appearance="listbox" placeholder="Select an emirate">
<AegovSelectOptionGroup label="Federal capital">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
</AegovSelectOptionGroup>
<AegovSelectOptionGroup label="Northern Emirates">
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
<AegovSelectOption value="shj">Sharjah</AegovSelectOption>
<AegovSelectOption value="ajm">Ajman</AegovSelectOption>
</AegovSelectOptionGroup>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Emirate</aegov-label>
<aegov-select field-id="select-grouped" name="emirate-grouped" appearance="listbox" placeholder="Select an emirate">
<aegov-select-option-group label="Federal capital">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select-option-group>
<aegov-select-option-group label="Northern Emirates">
<aegov-select-option value="dxb">Dubai</aegov-select-option>
<aegov-select-option value="shj">Sharjah</aegov-select-option>
<aegov-select-option value="ajm">Ajman</aegov-select-option>
</aegov-select-option-group>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption, AegovSelectOptionGroup } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-grouped',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption, AegovSelectOptionGroup],
template: `
<aegov-form-field>
<aegov-label>Emirate</aegov-label>
<aegov-select field-id="select-grouped" name="emirate-grouped" appearance="listbox" placeholder="Select an emirate">
<aegov-select-option-group label="Federal capital">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select-option-group>
<aegov-select-option-group label="Northern Emirates">
<aegov-select-option value="dxb">Dubai</aegov-select-option>
<aegov-select-option value="shj">Sharjah</aegov-select-option>
<aegov-select-option value="ajm">Ajman</aegov-select-option>
</aegov-select-option-group>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectGroupedComponent {}
Searchable
Set is-searchable="true" on a listbox-appearance select to add a search input above the option list. It filters case-insensitively as the user types; empty-message controls the text shown when nothing matches.
<aegov-form-field>
<aegov-label>Nationality</aegov-label>
<aegov-select field-id="select-searchable" name="nationality" appearance="listbox" is-searchable="true" placeholder="Search and select your nationality" empty-message="No matching country">
<aegov-select-option value="ae">United Arab Emirates</aegov-select-option>
<aegov-select-option value="sa">Saudi Arabia</aegov-select-option>
<aegov-select-option value="kw">Kuwait</aegov-select-option>
<aegov-select-option value="in">India</aegov-select-option>
<aegov-select-option value="pk">Pakistan</aegov-select-option>
<aegov-select-option value="ph">Philippines</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectSearchable() {
return (
<AegovFormField>
<AegovLabel>Nationality</AegovLabel>
<AegovSelect
fieldId="select-searchable"
name="nationality"
appearance="listbox"
isSearchable
placeholder="Search and select your nationality"
emptyMessage="No matching country"
>
<AegovSelectOption value="ae">United Arab Emirates</AegovSelectOption>
<AegovSelectOption value="sa">Saudi Arabia</AegovSelectOption>
<AegovSelectOption value="kw">Kuwait</AegovSelectOption>
<AegovSelectOption value="in">India</AegovSelectOption>
<AegovSelectOption value="pk">Pakistan</AegovSelectOption>
<AegovSelectOption value="ph">Philippines</AegovSelectOption>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Nationality</aegov-label>
<aegov-select field-id="select-searchable" name="nationality" appearance="listbox" is-searchable="true" placeholder="Search and select your nationality" empty-message="No matching country">
<aegov-select-option value="ae">United Arab Emirates</aegov-select-option>
<aegov-select-option value="sa">Saudi Arabia</aegov-select-option>
<aegov-select-option value="kw">Kuwait</aegov-select-option>
<aegov-select-option value="in">India</aegov-select-option>
<aegov-select-option value="pk">Pakistan</aegov-select-option>
<aegov-select-option value="ph">Philippines</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-searchable',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Nationality</aegov-label>
<aegov-select field-id="select-searchable" name="nationality" appearance="listbox" is-searchable="true" placeholder="Search and select your nationality" empty-message="No matching country">
<aegov-select-option value="ae">United Arab Emirates</aegov-select-option>
<aegov-select-option value="sa">Saudi Arabia</aegov-select-option>
<aegov-select-option value="kw">Kuwait</aegov-select-option>
<aegov-select-option value="in">India</aegov-select-option>
<aegov-select-option value="pk">Pakistan</aegov-select-option>
<aegov-select-option value="ph">Philippines</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectSearchableComponent {}
Multi-select
Set is-multiple="true" to allow more than one option to be selected — this forces listbox rendering regardless of appearance. The trigger collapses to a count summary ("2 selected") and each option shows its own checkbox.
<aegov-form-field>
<aegov-label>Languages</aegov-label>
<aegov-select field-id="select-multiple" name="languages" is-multiple="true" is-searchable="true" placeholder="Choose languages you speak">
<aegov-select-option value="ar">Arabic</aegov-select-option>
<aegov-select-option value="en">English</aegov-select-option>
<aegov-select-option value="ur">Urdu</aegov-select-option>
<aegov-select-option value="hi">Hindi</aegov-select-option>
<aegov-select-option value="fr">French</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectMultiple() {
return (
<AegovFormField>
<AegovLabel>Languages</AegovLabel>
<AegovSelect fieldId="select-multiple" name="languages" isMultiple isSearchable placeholder="Choose languages you speak">
<AegovSelectOption value="ar">Arabic</AegovSelectOption>
<AegovSelectOption value="en">English</AegovSelectOption>
<AegovSelectOption value="ur">Urdu</AegovSelectOption>
<AegovSelectOption value="hi">Hindi</AegovSelectOption>
<AegovSelectOption value="fr">French</AegovSelectOption>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Languages</aegov-label>
<aegov-select field-id="select-multiple" name="languages" is-multiple="true" is-searchable="true" placeholder="Choose languages you speak">
<aegov-select-option value="ar">Arabic</aegov-select-option>
<aegov-select-option value="en">English</aegov-select-option>
<aegov-select-option value="ur">Urdu</aegov-select-option>
<aegov-select-option value="hi">Hindi</aegov-select-option>
<aegov-select-option value="fr">French</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-multiple',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Languages</aegov-label>
<aegov-select field-id="select-multiple" name="languages" [isMultiple]="true" [isSearchable]="true" placeholder="Choose languages you speak">
<aegov-select-option value="ar">Arabic</aegov-select-option>
<aegov-select-option value="en">English</aegov-select-option>
<aegov-select-option value="ur">Urdu</aegov-select-option>
<aegov-select-option value="hi">Hindi</aegov-select-option>
<aegov-select-option value="fr">French</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectMultipleComponent {}
Clearable
Set is-clearable="true" on a listbox-appearance select to show a small "×" button inside the trigger — visible only once something is selected — that resets the value without reopening the panel.
<aegov-form-field>
<aegov-label>Service status</aegov-label>
<aegov-select field-id="select-clearable" name="service-status" appearance="listbox" is-clearable="true" placeholder="Filter by service status">
<aegov-select-option value="active">Active</aegov-select-option>
<aegov-select-option value="pending">Pending review</aegov-select-option>
<aegov-select-option value="rejected">Rejected</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectClearable() {
return (
<AegovFormField>
<AegovLabel>Service status</AegovLabel>
<AegovSelect fieldId="select-clearable" name="service-status" appearance="listbox" isClearable placeholder="Filter by service status">
<AegovSelectOption value="active">Active</AegovSelectOption>
<AegovSelectOption value="pending">Pending review</AegovSelectOption>
<AegovSelectOption value="rejected">Rejected</AegovSelectOption>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Service status</aegov-label>
<aegov-select field-id="select-clearable" name="service-status" appearance="listbox" is-clearable="true" placeholder="Filter by service status">
<aegov-select-option value="active">Active</aegov-select-option>
<aegov-select-option value="pending">Pending review</aegov-select-option>
<aegov-select-option value="rejected">Rejected</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-clearable',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Service status</aegov-label>
<aegov-select field-id="select-clearable" name="service-status" appearance="listbox" [isClearable]="true" placeholder="Filter by service status">
<aegov-select-option value="active">Active</aegov-select-option>
<aegov-select-option value="pending">Pending review</aegov-select-option>
<aegov-select-option value="rejected">Rejected</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectClearableComponent {}
Disabled options and disabled select
Disable a single aegov-select-option with is-disabled="true" — it stays visible, greyed out, and is skipped by keyboard navigation. Set is-disabled on aegov-select itself to disable the whole control.
<aegov-form-field>
<aegov-label>Appointment slot</aegov-label>
<aegov-select field-id="select-disabled-opts" name="appointment-slot" appearance="listbox" placeholder="Select an appointment slot">
<aegov-select-option value="0900">09:00 — Available</aegov-select-option>
<aegov-select-option value="1000" is-disabled="true">10:00 — Fully booked</aegov-select-option>
<aegov-select-option value="1100">11:00 — Available</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Ministry</aegov-label>
<aegov-select field-id="select-disabled-whole" name="ministry-disabled" is-disabled="true" placeholder="Select a ministry (disabled)">
<aegov-select-option value="moi">Ministry of Interior</aegov-select-option>
<aegov-select-option value="mof">Ministry of Finance</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectDisabled() {
return (
<>
<AegovFormField>
<AegovLabel>Appointment slot</AegovLabel>
<AegovSelect fieldId="select-disabled-opts" name="appointment-slot" appearance="listbox" placeholder="Select an appointment slot">
<AegovSelectOption value="0900">09:00 — Available</AegovSelectOption>
<AegovSelectOption value="1000" isDisabled>10:00 — Fully booked</AegovSelectOption>
<AegovSelectOption value="1100">11:00 — Available</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Ministry</AegovLabel>
<AegovSelect fieldId="select-disabled-whole" name="ministry-disabled" isDisabled placeholder="Select a ministry (disabled)">
<AegovSelectOption value="moi">Ministry of Interior</AegovSelectOption>
<AegovSelectOption value="mof">Ministry of Finance</AegovSelectOption>
</AegovSelect>
</AegovFormField>
</>
);
}
<template>
<aegov-form-field>
<aegov-label>Appointment slot</aegov-label>
<aegov-select field-id="select-disabled-opts" name="appointment-slot" appearance="listbox" placeholder="Select an appointment slot">
<aegov-select-option value="0900">09:00 — Available</aegov-select-option>
<aegov-select-option value="1000" is-disabled="true">10:00 — Fully booked</aegov-select-option>
<aegov-select-option value="1100">11:00 — Available</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Ministry</aegov-label>
<aegov-select field-id="select-disabled-whole" name="ministry-disabled" is-disabled="true" placeholder="Select a ministry (disabled)">
<aegov-select-option value="moi">Ministry of Interior</aegov-select-option>
<aegov-select-option value="mof">Ministry of Finance</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-disabled',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Appointment slot</aegov-label>
<aegov-select field-id="select-disabled-opts" name="appointment-slot" appearance="listbox" placeholder="Select an appointment slot">
<aegov-select-option value="0900">09:00 — Available</aegov-select-option>
<aegov-select-option value="1000" [isDisabled]="true">10:00 — Fully booked</aegov-select-option>
<aegov-select-option value="1100">11:00 — Available</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Ministry</aegov-label>
<aegov-select field-id="select-disabled-whole" name="ministry-disabled" [isDisabled]="true" placeholder="Select a ministry (disabled)">
<aegov-select-option value="moi">Ministry of Interior</aegov-select-option>
<aegov-select-option value="mof">Ministry of Finance</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectDisabledComponent {}
Sizes
size accepts five tokens, from xs up to xl, matching aegov-input's height at each step. It accepts a responsive breakpoint string (e.g. size="sm md:base").
<aegov-form-field>
<aegov-label>Extra small</aegov-label>
<aegov-select field-id="select-size-xs" name="select-size-xs" size="xs" placeholder="Extra small">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Small</aegov-label>
<aegov-select field-id="select-size-sm" name="select-size-sm" size="sm" placeholder="Small">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Base (default)</aegov-label>
<aegov-select field-id="select-size-base" name="select-size-base" size="base" placeholder="Base (default)">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Large</aegov-label>
<aegov-select field-id="select-size-lg" name="select-size-lg" size="lg" placeholder="Large">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Extra large</aegov-label>
<aegov-select field-id="select-size-xl" name="select-size-xl" size="xl" placeholder="Extra large">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectSizes() {
return (
<>
<AegovFormField>
<AegovLabel>Extra small</AegovLabel>
<AegovSelect fieldId="select-size-xs" name="select-size-xs" size="xs" placeholder="Extra small">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Small</AegovLabel>
<AegovSelect fieldId="select-size-sm" name="select-size-sm" size="sm" placeholder="Small">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Base (default)</AegovLabel>
<AegovSelect fieldId="select-size-base" name="select-size-base" size="base" placeholder="Base (default)">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Large</AegovLabel>
<AegovSelect fieldId="select-size-lg" name="select-size-lg" size="lg" placeholder="Large">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Extra large</AegovLabel>
<AegovSelect fieldId="select-size-xl" name="select-size-xl" size="xl" placeholder="Extra large">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
</AegovSelect>
</AegovFormField>
</>
);
}
<template>
<aegov-form-field>
<aegov-label>Extra small</aegov-label>
<aegov-select field-id="select-size-xs" name="select-size-xs" size="xs" placeholder="Extra small">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Small</aegov-label>
<aegov-select field-id="select-size-sm" name="select-size-sm" size="sm" placeholder="Small">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Base (default)</aegov-label>
<aegov-select field-id="select-size-base" name="select-size-base" size="base" placeholder="Base (default)">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Large</aegov-label>
<aegov-select field-id="select-size-lg" name="select-size-lg" size="lg" placeholder="Large">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Extra large</aegov-label>
<aegov-select field-id="select-size-xl" name="select-size-xl" size="xl" placeholder="Extra large">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-sizes',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Extra small</aegov-label>
<aegov-select field-id="select-size-xs" name="select-size-xs" size="xs" placeholder="Extra small">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Small</aegov-label>
<aegov-select field-id="select-size-sm" name="select-size-sm" size="sm" placeholder="Small">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Base (default)</aegov-label>
<aegov-select field-id="select-size-base" name="select-size-base" size="base" placeholder="Base (default)">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Large</aegov-label>
<aegov-select field-id="select-size-lg" name="select-size-lg" size="lg" placeholder="Large">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Extra large</aegov-label>
<aegov-select field-id="select-size-xl" name="select-size-xl" size="xl" placeholder="Extra large">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectSizesComponent {}
Variant
variant selects the colour family for the trigger's idle border/ring, the value text, and the selected-option fill in the open list.
| Variant | Idle border | Value text | Selected-option fill |
|---|---|---|---|
primary |
primary-600 |
primary-900 |
primary-600 |
secondary |
secondary-600 |
secondary-900 |
secondary-600 |
neutral-max |
aeblack-800 |
aeblack-950 |
aeblack-800 |
neutral-min |
aeblack-400 |
aeblack-700 |
aeblack-800 |
Variant example
<aegov-form-field>
<aegov-label>Primary</aegov-label>
<aegov-select field-id="select-variant-primary" name="select-variant-primary" variant="primary" placeholder="Primary">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Secondary</aegov-label>
<aegov-select field-id="select-variant-secondary" name="select-variant-secondary" variant="secondary" placeholder="Secondary">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Neutral-max</aegov-label>
<aegov-select field-id="select-variant-neutral-max" name="select-variant-neutral-max" variant="neutral-max" placeholder="Neutral-max">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Neutral-min</aegov-label>
<aegov-select field-id="select-variant-neutral-min" name="select-variant-neutral-min" variant="neutral-min" placeholder="Neutral-min">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectVariants() {
return (
<>
<AegovFormField>
<AegovLabel>Primary</AegovLabel>
<AegovSelect fieldId="select-variant-primary" name="select-variant-primary" variant="primary" placeholder="Primary">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Secondary</AegovLabel>
<AegovSelect fieldId="select-variant-secondary" name="select-variant-secondary" variant="secondary" placeholder="Secondary">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Neutral-max</AegovLabel>
<AegovSelect fieldId="select-variant-neutral-max" name="select-variant-neutral-max" variant="neutral-max" placeholder="Neutral-max">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
</AegovSelect>
</AegovFormField>
<AegovFormField>
<AegovLabel>Neutral-min</AegovLabel>
<AegovSelect fieldId="select-variant-neutral-min" name="select-variant-neutral-min" variant="neutral-min" placeholder="Neutral-min">
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
</AegovSelect>
</AegovFormField>
</>
);
}
<template>
<aegov-form-field>
<aegov-label>Primary</aegov-label>
<aegov-select field-id="select-variant-primary" name="select-variant-primary" variant="primary" placeholder="Primary">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Secondary</aegov-label>
<aegov-select field-id="select-variant-secondary" name="select-variant-secondary" variant="secondary" placeholder="Secondary">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Neutral-max</aegov-label>
<aegov-select field-id="select-variant-neutral-max" name="select-variant-neutral-max" variant="neutral-max" placeholder="Neutral-max">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Neutral-min</aegov-label>
<aegov-select field-id="select-variant-neutral-min" name="select-variant-neutral-min" variant="neutral-min" placeholder="Neutral-min">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-variants',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Primary</aegov-label>
<aegov-select field-id="select-variant-primary" name="select-variant-primary" variant="primary" placeholder="Primary">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Secondary</aegov-label>
<aegov-select field-id="select-variant-secondary" name="select-variant-secondary" variant="secondary" placeholder="Secondary">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Neutral-max</aegov-label>
<aegov-select field-id="select-variant-neutral-max" name="select-variant-neutral-max" variant="neutral-max" placeholder="Neutral-max">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
<aegov-form-field>
<aegov-label>Neutral-min</aegov-label>
<aegov-select field-id="select-variant-neutral-min" name="select-variant-neutral-min" variant="neutral-min" placeholder="Neutral-min">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectVariantsComponent {}
Visible items and pre-selected value
visible-items caps how many options fit in the panel before it scrolls (default 6). Pre-select a value with value — it must match the value of a real aegov-select-option to take effect.
<aegov-form-field>
<aegov-label>Emirate</aegov-label>
<aegov-select field-id="select-visible-items" name="emirate-preselected" appearance="listbox" is-searchable="true" visible-items="4" value="ad" placeholder="Select an emirate">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
<aegov-select-option value="shj">Sharjah</aegov-select-option>
<aegov-select-option value="ajm">Ajman</aegov-select-option>
<aegov-select-option value="uaq">Umm Al Quwain</aegov-select-option>
<aegov-select-option value="rak">Ras Al Khaimah</aegov-select-option>
<aegov-select-option value="fuj">Fujairah</aegov-select-option>
</aegov-select>
</aegov-form-field>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function SelectVisibleItems() {
return (
<AegovFormField>
<AegovLabel>Emirate</AegovLabel>
<AegovSelect
fieldId="select-visible-items"
name="emirate-preselected"
appearance="listbox"
isSearchable
visibleItems={4}
value="ad"
placeholder="Select an emirate"
>
<AegovSelectOption value="ad">Abu Dhabi</AegovSelectOption>
<AegovSelectOption value="dxb">Dubai</AegovSelectOption>
<AegovSelectOption value="shj">Sharjah</AegovSelectOption>
<AegovSelectOption value="ajm">Ajman</AegovSelectOption>
<AegovSelectOption value="uaq">Umm Al Quwain</AegovSelectOption>
<AegovSelectOption value="rak">Ras Al Khaimah</AegovSelectOption>
<AegovSelectOption value="fuj">Fujairah</AegovSelectOption>
</AegovSelect>
</AegovFormField>
);
}
<template>
<aegov-form-field>
<aegov-label>Emirate</aegov-label>
<aegov-select field-id="select-visible-items" name="emirate-preselected" appearance="listbox" is-searchable="true" visible-items="4" value="ad" placeholder="Select an emirate">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
<aegov-select-option value="shj">Sharjah</aegov-select-option>
<aegov-select-option value="ajm">Ajman</aegov-select-option>
<aegov-select-option value="uaq">Umm Al Quwain</aegov-select-option>
<aegov-select-option value="rak">Ras Al Khaimah</aegov-select-option>
<aegov-select-option value="fuj">Fujairah</aegov-select-option>
</aegov-select>
</aegov-form-field>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-select-visible-items',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<aegov-form-field>
<aegov-label>Emirate</aegov-label>
<aegov-select field-id="select-visible-items" name="emirate-preselected" appearance="listbox" [isSearchable]="true" [visibleItems]="4" value="ad" placeholder="Select an emirate">
<aegov-select-option value="ad">Abu Dhabi</aegov-select-option>
<aegov-select-option value="dxb">Dubai</aegov-select-option>
<aegov-select-option value="shj">Sharjah</aegov-select-option>
<aegov-select-option value="ajm">Ajman</aegov-select-option>
<aegov-select-option value="uaq">Umm Al Quwain</aegov-select-option>
<aegov-select-option value="rak">Ras Al Khaimah</aegov-select-option>
<aegov-select-option value="fuj">Fujairah</aegov-select-option>
</aegov-select>
</aegov-form-field>
`,
})
export class SelectVisibleItemsComponent {}
RTL support
The select is direction-agnostic. When the document or any ancestor is dir="rtl", the trigger, dropdown panel, search input, and option layout all mirror automatically, and option/group labels accept Arabic content directly. No extra configuration is needed.
<div dir="rtl">
<aegov-form-field>
<aegov-label>الوزارة</aegov-label>
<aegov-select field-id="select-rtl" name="ministry-rtl" appearance="listbox" is-searchable="true" placeholder="اختر الوزارة" empty-message="لا توجد نتائج مطابقة">
<aegov-select-option value="moi">وزارة الداخلية</aegov-select-option>
<aegov-select-option value="mof">وزارة المالية</aegov-select-option>
<aegov-select-option value="moh">وزارة الصحة ووقاية المجتمع</aegov-select-option>
</aegov-select>
</aegov-form-field>
</div>
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-react';
export default function RtlSelect() {
return (
<div dir="rtl">
<AegovFormField>
<AegovLabel>الوزارة</AegovLabel>
<AegovSelect
fieldId="select-rtl"
name="ministry-rtl"
appearance="listbox"
isSearchable
placeholder="اختر الوزارة"
emptyMessage="لا توجد نتائج مطابقة"
>
<AegovSelectOption value="moi">وزارة الداخلية</AegovSelectOption>
<AegovSelectOption value="mof">وزارة المالية</AegovSelectOption>
<AegovSelectOption value="moh">وزارة الصحة ووقاية المجتمع</AegovSelectOption>
</AegovSelect>
</AegovFormField>
</div>
);
}
<template>
<div dir="rtl">
<aegov-form-field>
<aegov-label>الوزارة</aegov-label>
<aegov-select field-id="select-rtl" name="ministry-rtl" appearance="listbox" is-searchable="true" placeholder="اختر الوزارة" empty-message="لا توجد نتائج مطابقة">
<aegov-select-option value="moi">وزارة الداخلية</aegov-select-option>
<aegov-select-option value="mof">وزارة المالية</aegov-select-option>
<aegov-select-option value="moh">وزارة الصحة ووقاية المجتمع</aegov-select-option>
</aegov-select>
</aegov-form-field>
</div>
</template>
import { Component } from '@angular/core';
import { AegovFormField, AegovLabel, AegovSelect, AegovSelectOption } from '@aegov/designsystem-angular';
@Component({
selector: 'app-rtl-select',
imports: [AegovFormField, AegovLabel, AegovSelect, AegovSelectOption],
template: `
<div dir="rtl">
<aegov-form-field>
<aegov-label>الوزارة</aegov-label>
<aegov-select field-id="select-rtl" name="ministry-rtl" appearance="listbox" [isSearchable]="true" placeholder="اختر الوزارة" empty-message="لا توجد نتائج مطابقة">
<aegov-select-option value="moi">وزارة الداخلية</aegov-select-option>
<aegov-select-option value="mof">وزارة المالية</aegov-select-option>
<aegov-select-option value="moh">وزارة الصحة ووقاية المجتمع</aegov-select-option>
</aegov-select>
</aegov-form-field>
</div>
`,
})
export class RtlSelectComponent {}
Usage
Here is the recommended usage of a select on any website or application. These are recommended usage guides, however the developer must use the best practices of web and application development to accurately use this component.
Default to the native appearance; reach for listbox only when you need what it offers
Search, multi-select, grouped options, and a clear button are all real, useful features — but the native <select> is lighter, faster, and gives the best mobile experience whenever none of them are actually needed.
Turn on is-searchable for any list a user would otherwise have to scroll through
Country lists, service categories, and time slots are all much faster to use with a filter than by scanning dozens of options one at a time.
Do not use a single-select dropdown for two options where a toggle or radio pair reads faster
A two-option choice (Yes/No, Male/Female) is usually faster to scan and act on as visible radios or a toggle than hidden behind a dropdown that needs an extra click to even see the choices.
Do not rely on <aegov-select-option> rendering standalone, or outside <aegov-select>
It throws a real error at load time if used outside a parent select — it isn't a general-purpose "list item" component, only a declarative description of one option.
API reference
The following are the properties and references of a select
aegov-select default properties
| Attribute | Description | Type | Default |
|---|---|---|---|
| DOM |
| auto-generated |
|
|
|
|
| Allow more than one option to be selected. Forces listbox rendering regardless of |
|
|
| Currently selected value. A comma-separated string for multi-select. Must match the |
|
|
| Text shown when nothing is selected — a disabled first |
| (none) |
| Form field name for submission. |
| (none) |
| Show a search input above the option list that filters case-insensitively as the user types. Listbox appearance only — has no effect in native mode. |
|
|
| Text shown when a search yields no results. Empty string falls back to a bilingual default ("No results found" / Arabic) resolved from the document's direction. |
|
|
| Maximum number of options visible in the listbox panel before it scrolls. |
|
|
| Show a small clear ("×") button at the end of the listbox trigger, visible only once something is selected (and hidden while the select is disabled), that resets the value to empty. It is a separate, keyboard-reachable |
|
|
| Size token matching |
|
|
| Colour family for the trigger/border, the value text, and the selected-option fill. The focus ring follows the variant's support colour (camel for |
|
|
| Disables the entire control. |
|
|
| Marks the field as required. |
|
|
| Visual + |
|
|
| Inline error message shown when |
|
|
| Helper text shown below the control. It stays visible while an error shows (below the error message), and both describe the field. Use the |
|
|
| Additional CSS classes applied to the inner control — the native |
| (none) |
This component renders inside a real shadow DOM, so extra-class only applies margin/padding (spacing) utilities — e.g. mt-4, md:px-6. Colour, border, typography, and every other visual utility are silently ignored: this is an isolated component whose internal styles can't be overridden, keeping it visually consistent wherever it's used.
aegov-select-option properties
| Attribute | Description | Type | Default |
|---|---|---|---|
| The value submitted or surfaced in change events when this option is selected. |
|
|
| Disables this option — it remains visible (greyed out) but cannot be selected, and is skipped during keyboard navigation. |
|
|
aegov-select-option-group properties
| Attribute | Description | Type | Default |
|---|---|---|---|
| Group label rendered as a non-interactive header above its options, in both appearances. |
|
|
Slots
| Slot | Description | Component |
|---|---|---|
(default) | Place | aegov-select |
(default) | The option's visible label text. | aegov-select-option |
(default) | The grouped | aegov-select-option-group |
| Rich markup for the hint, in place of the plain-text | aegov-select |
| Rich markup for the error message, in place of the plain-text | aegov-select |
Events
| Event | Description | Detail |
|---|---|---|
| Fires when the selected value changes. |
|
| Fires when the listbox dropdown opens. Listbox appearance only. |
|
| Fires when the listbox dropdown closes. Listbox appearance only. |
|
| Unified validation event. See §2.3. |
|
Methods
| Method | Description |
|---|---|
| Imperatively re-runs validation and emits |
| Mirrors |
Pass-through attributes
| Attribute | Notes | Forwards to |
|---|---|---|
|
| native |
| Copied to the native | native |
| Forwarded on the default (native) appearance only. | native |
| Not forwarded. Use | n/a |
| Applied to the host element — stays host-only, never forwarded inward. | host |
Notes
The following notes are applicable of this component.
Built-in accessibility
- The select takes its accessible name from the label around or pointing at it —
aegov-form-field+aegov-label,<aegov-label for>,aria-labelledbyoraria-labelon the select — and passes it to the real control inside its shadow root, in both appearances; changes to the label text are followed. - The default appearance renders a real native
<select>, so it inherits all native keyboard support, OS-level pickers on mobile, and screen-reader announcements for free — nothing is reimplemented. - The listbox appearance follows the WAI-ARIA combobox pattern: the trigger has
role="combobox",aria-haspopup="listbox",aria-expanded, andaria-controlspointing at the panel; the panel hasrole="listbox"; each option hasrole="option"andaria-selected; andaria-activedescendanton the trigger tracks the focused option. - Grouped options use
role="group"named witharia-labelfrom the group'slabel; the visible header is hidden from assistive technology so it isn't read twice. In the default appearance, groups render as real<optgroup>elements. - When
is-searchable, the search input itself also declaresrole="combobox"with its ownaria-controls/aria-activedescendant, since focus moves into it while the dropdown is open. - A search that matches nothing is announced through a
role="status"region. - The search input's placeholder/label, the clear button's
aria-labeland the multi-select count ("3 selected" / "تم اختيار 3") are bilingual (English/Arabic, resolved from the document's direction) — no developer translation needed. - The error region only takes
role="alert"once the user has genuinely blurred the whole component (focus leaving it entirely, not just moving from the trigger into the search input or an option),validate('submit')has run, or a form validity check has found the field invalid, so a validation message present at initial load isn't announced as an interruption. - A disabled
aegov-select-optionremains visible (greyed out) but is skipped entirely during keyboard navigation (arrow keys, Home/End, typeahead) and cannot be clicked.
Developer responsibility
The following is required for a developer to add additionally or pay attention to regarding this component.
- Give every select a visible label: wrap it in
aegov-form-fieldwith anaegov-label(as in every example on this page), or point a standalone<aegov-label for="<field-id>">at it, or usearia-labelledbyon the select. Aplaceholderis not a label — it is only shown while nothing is selected, is exposed as the value rather than the name, and disappears once a choice is made (and in multiple mode). - Prefer the default (native) appearance whenever search and multi-select aren't needed — it's lighter, faster, and gives the best experience on mobile, where the OS renders its own picker.
- For long lists (countries, services, time slots), set
is-searchable="true"so keyboard and screen-reader users can filter instead of scanning every option. <aegov-select-option>must be a descendant of<aegov-select>(directly, or nested inside an<aegov-select-option-group>) — using it standalone throws an error at load time, by design, since its only job is to describe one entry in a specific parent select's option list.- Keep option labels reasonably short — the trigger truncates a long single-select label, and multi-select always collapses to a count ("3 selected") rather than listing every choice.
Additional notes
sizeaccepts a responsive breakpoint string, the same convention used by Badge, Banner, and Checkbox (e.g.size="sm md:base").- Setting
is-multiple="true"forces listbox rendering even ifappearance="default"is also set (or omitted) — there is no native multi-select UI in this design system. name/form submission is handled differently per appearance: in native mode the real<select name>submits directly (mirrored ontoElementInternalstoo, since the native element lives inside a shadow root and wouldn't otherwise be seen by aFormDataread); in listbox mode it's entirelyElementInternals-driven, and multi-select submits oneFormDataentry per selected value, not one comma-joined string.- The raw
<aegov-select-option>/<aegov-select-option-group>children are never rendered visibly themselves — they're a declarative data source only, parsed once into an internal option list that drives the real<option>elements (native mode) or<div role="option">elements (listbox mode).
Keyboard support (listbox appearance)
| Key | Function |
|---|---|
| Enter / Space / Arrow Down / Arrow Up | Opens the dropdown when closed, giving visual focus to the currently-selected option (or the first enabled option if none is selected). Home / End on a closed select open it on the first/last enabled option. |
| Arrow Down / Arrow Up | While open, moves focus to the next/previous enabled option. |
| Home / End | Jumps focus to the first/last enabled option (inside the search input they move the text caret instead). |
| Page Up / Page Down | Moves focus 10 enabled options up/down. |
| Enter / Space | Selects the focused option. In single-select mode this also closes the dropdown; in multi-select it stays open so more options can be picked. |
| Escape | Closes the dropdown without changing the selection and returns focus to the trigger. Only the dropdown closes, not a surrounding modal or drawer. |
| Alt + Arrow Up | In single-select, selects the focused option and closes the dropdown; in multi-select, just closes it. |
| Typing a character | When is-searchable is off, jumps focus to the next enabled option whose label starts with what's been typed (a short-lived buffer, cleared after ~500ms of inactivity) — it moves focus, it does not hide non-matching options. When is-searchable is on, focus is already in the search input on open, and typing there filters the option list instead. Typing on a closed select opens it first. |
| Tab | In single-select, selects the focused option; then closes the dropdown and moves focus to the next focusable element (does not cycle inside the panel). |
Keyboard support for the default (native) appearance is provided entirely by the browser's own <select> implementation.