Skip to content
OAIT Design System

Design system / Components

Select

The browser's own drop-down list, drawn as a 56px field with a 24px arrow_drop_down at the inline end, for choosing one value from a long or familiar list.

When to use

  • One value from a list the person knows or does not need to compare: a sort order ("Sort by"), a location, a country code, what a spreadsheet column holds.
  • A list too long to show as radios, or a form where space is short (a filter row, the phone fieldset).
  • Phones open their own picker, which is easier to use than anything drawn on the page (D-CAI-11).

When not to use

  • A few options people compare, each worth reading: show them all as radios or choice cards; answers in a form are choice cards (canonical §10.7, §10.8).
  • Several values at once: checkboxes.
  • A long or rich list to search (people, companies): a search field with radio rows in a dialog or bottom sheet, as Global ID's host picker does. There is no custom listbox in 1.0 (canonical §10.4, D-CAI-11).
  • A scale: choice cards in a Likert row; there is no slider in 1.0.
  • Moving to another page or changing the language: links, or the language switcher (a disclosure, never a select) (D-BCP-29).
  • Actions on a row: a menu.

Anatomy

  1. Label (<label for>): text-label-md in on-surface, 6px above the box; wraps.
  2. Control box (.oa-field__control): set dir="ltr" on it only for Latin-only values such as a calling code.
  3. Leading icon (optional): 20px, on-surface-variant, 16px from the inline start (location_on for places).
  4. Select (<select class="oa-field__input">): the 56px box, its own arrow removed (appearance: none).
  5. Arrow: arrow_drop_down, 24px, on-surface-variant, 12px from the inline end, decorative; the value keeps 48px clear of it.
  6. Message row: the helper or the error, 4px under the box, in text-body-md.

Variants

Variant Use for Key tokens
Default sort orders, mappings, short familiar lists --color-surface-container-lowest, --color-outline, --radius-field
With a leading icon a place ("Location"), where the icon says what the list holds --size-icon-md, --color-on-surface-variant
Country code the first control of the phone fieldset; named "Country code" by its own aria-label, since the legend names the group control box dir="ltr"; options "+961 Lebanon"

Sizes

Size Height Padding Type style Icon size
Field (the only size) 56px (--size-field, h-14) 16px at the start (ps-4), 48px with a leading icon (ps-12); 48px at the end for the arrow (pe-12) value text-body-lg; label text-label-md; messages text-body-md leading 20px (--size-icon-md); arrow 24px (--size-icon-lg)

Tokens

Part Property Token
Label color, type --color-on-surface; --text-label-md (text-label-md)
Box height, radius --size-field (h-14); --radius-field (rounded-field)
Box border, fill 1px --color-outline; --color-surface-container-lowest
Value color, type --color-on-surface; --text-body-lg
Arrow and leading icon color, size --color-on-surface-variant; --size-icon-lg, --size-icon-md
Focus border, ring --color-primary-ink; the base ring (--size-focus-ring, --size-focus-offset, --color-focus-ring)
Error border, message --color-error; message weight --font-weight-medium
Disabled border, content --color-on-surface at --opacity-state-disabled-container and --opacity-state-disabled-content
Motion color changes --duration-short-3, --ease-standard

The native list that opens follows color-scheme, which the base CSS sets from the active theme, so it is dark in the dark theme (D-CAI-12).

States

State Border Value and arrow Message How
Enabled 1px outline on-surface, arrow on-surface-variant helper —
Hover no change — — there is no hover state (D-CAI-10)
Focus 1px primary-ink and the ring — — :focus and the base ring
Open the browser's or the phone's own list — — native
Error 1px error; 2px while focused, with no shift — the filled error icon and words <select aria-invalid="true">
Disabled on-surface at 12%, no fill 38% 38% the disabled attribute; never to signal invalid input

A select cannot be read-only. A value that comes from an official record is shown as text, or in a read-only text field with its lock line.

Behavior

  • The select is the native element: arrow keys move through the options, typing a letter jumps to it, Alt and Down open the list; on phones the system picker opens (D-CAI-11).
  • Options are listed in the page language. Countries are sorted by name with Intl.Collator and named with Intl.DisplayNames; calling codes come first in the option text ("+961 Lebanon") (D-CAI-11, canonical §14.3).
  • Start on a sensible default ("Best match", "All of MENA", +961 Lebanon). When the person must choose and no default is right, the first option is "Choose one" with an empty value, and the select is required.
  • Validation follows the text field: checked on submit, then live; the error replaces the helper; focus moves to the first invalid field.
  • A filter select on a listing page applies at once and updates the result count in the page's status region (canonical §11 template 4).
  • A closed select cuts a long value with an ellipsis; the start of the value (the calling code, the first words) stays visible.
  • Only colors change, over duration-short-3 with ease-standard.

Accessibility

  • A visible <label for>, or, for the country code inside the phone fieldset, its own name ("Country code"), since the legend names the group.
  • The arrow and the leading icon are decorative (aria-hidden on their span); the select announces itself as a list.
  • Errors: <select aria-invalid="true"> and aria-describedby pointing at the message; never a live region (D-CAI-10).
  • The 56px box is the target; the value is 16px.
  • Contrast: the outline edge is 4.51:1 on white and 6.08:1 in dark; the value 17.12:1 (D-CAI-09 measurements).

RTL and languages

  • In Arabic the arrow sits at the inline end, on the left, and a leading icon on the right; the value aligns right.
  • A select whose control box is dir="ltr" (the country code) keeps its arrow on the right and its value left to right on Arabic pages (D-CAI-11).
  • The arrow is never mirrored; it only changes side (canonical §8.3).
  • Arabic options use the same 56px box with taller lines; French option text runs longer, so keep the closed select wide enough at 360px for the start of the value.

Content

  • Label: a noun phrase naming what is chosen: "Sort by", "Location", "Country code", "What “Column B” holds". No colon.
  • Options: sentence case, short, parallel, in the page language: "Best match" / "Newest first"; "Full name", "Mobile", "Email", "Don’t import".
  • Empty first option: "Choose one" / "اختر واحدًا" / "Choisissez-en une" when no default fits.
  • Error: verb first, what to choose: "Choose a column of mobile numbers or of emails." / "اختر عمودًا لأرقام الهاتف أو للبريد الإلكتروني." / "Choisissez une colonne de numéros de mobile ou d’e-mails." (canonical §12.4).
  • Arabic and French labels: "نوع الشخص" / "Type de personne"; "رمز الدولة" / "Indicatif du pays".

Do and don't

Do Don't
Use the native select with arrow_drop_down. Draw a custom listbox or keep the browser's own arrow.
Show two to five compared options as radios or choice cards. Hide a short, important choice inside a select.
Put the calling code first ("+961 Lebanon") and keep the box dir="ltr". Mirror the calling code or the arrow in Arabic.
Start on a sensible default, or on "Choose one" with required. Start on an option the person did not choose and submit it silently.
Let a filter select apply at once on a listing page. Make a select navigate to another page.

Code

HTML (reference CSS)

<div class="oa-field oa-field--select">
  <label class="oa-field__label" for="sel-sort">Sort by</label>
  <div class="oa-field__control">
    <select class="oa-field__input" id="sel-sort" name="sort">
      <option value="relevance" selected>Best match</option>
      <option value="newest">Newest first</option>
    </select>
    <span class="oa-field__trailing" aria-hidden="true"><span class="oa-icon" translate="no">arrow_drop_down</span></span>
  </div>
</div>

With a leading icon (Global Jobs):

<div class="oa-field oa-field--select">
  <label class="oa-field__label" for="sel-location">Location</label>
  <div class="oa-field__control">
    <span class="oa-field__leading" aria-hidden="true"><span class="oa-icon" translate="no">location_on</span></span>
    <select class="oa-field__input" id="sel-location" name="location">
      <option value="" selected>All of MENA</option>
      <option value="lebanon">Lebanon</option>
      <option value="beirut">Beirut, Lebanon</option>
    </select>
    <span class="oa-field__trailing" aria-hidden="true"><span class="oa-icon" translate="no">arrow_drop_down</span></span>
  </div>
</div>

Error (Global ID guest import):

<div class="oa-field oa-field--select">
  <label class="oa-field__label" for="sel-column-b">What “Column B” holds</label>
  <div class="oa-field__control">
    <select class="oa-field__input" id="sel-column-b" name="column-b" aria-invalid="true" aria-describedby="sel-column-b-error">
      <option value="full-name">Full name</option>
      <option value="mobile">Mobile</option>
      <option value="email">Email</option>
      <option value="ignore" selected>Don’t import</option>
    </select>
    <span class="oa-field__trailing" aria-hidden="true"><span class="oa-icon" translate="no">arrow_drop_down</span></span>
  </div>
  <p class="oa-field__error" id="sel-column-b-error"><span class="oa-icon oa-icon--filled" aria-hidden="true" translate="no">error</span>Choose a column of mobile numbers or of emails.</p>
</div>

Arabic:

<div dir="rtl" lang="ar">
  <div class="oa-field oa-field--select">
    <label class="oa-field__label" for="sel-ar-type">نوع الشخص</label>
    <div class="oa-field__control">
      <select class="oa-field__input" id="sel-ar-type" name="type-ar">
        <option value="faculty" selected>عضو هيئة التدريس</option>
        <option value="staff">موظف</option>
        <option value="guest">ضيف</option>
      </select>
      <span class="oa-field__trailing" aria-hidden="true"><span class="oa-icon" translate="no">arrow_drop_down</span></span>
    </div>
  </div>
</div>

Tailwind CSS v4

<div class="flex flex-col">
  <label for="sort" class="mb-1.5 text-label-md text-on-surface">Sort by</label>
  <div class="relative">
    <select id="sort" name="sort" class="block h-14 w-full min-w-0 cursor-pointer appearance-none truncate rounded-field border border-outline bg-surface-container-lowest ps-4 pe-12 text-body-lg text-on-surface transition-colors duration-short-3 ease-standard focus:border-primary-ink aria-invalid:border-error aria-invalid:focus:shadow-[inset_0_0_0_1px_var(--color-error)] disabled:cursor-default disabled:border-on-surface/12 disabled:bg-transparent disabled:text-on-surface/38">
      <option value="relevance" selected>Best match</option>
      <option value="newest">Newest first</option>
    </select>
    <span class="pointer-events-none absolute inset-y-0 end-3 flex items-center text-on-surface-variant" aria-hidden="true"><span class="oa-icon" translate="no">arrow_drop_down</span></span>
  </div>
</div>

With a leading icon, the select takes ps-12 and the icon pointer-events-none absolute inset-y-0 start-4 flex items-center text-on-surface-variant around a 20px icon. Messages are the text field's.

React

<Select
  id="sort"
  label={t('jobs.sort')}
  options={[
    { value: 'relevance', label: t('jobs.sortRelevance') },
    { value: 'newest', label: t('jobs.sortNewest') },
  ]}
  value={sort}
  onChange={(event) => setSort(event.target.value)}
/>
Prop Type Default Description
id string required The select's id; messages take {id}-hint and {id}-error.
label string required The visible label (or, inside the phone fieldset, the accessible name "Country code").
options { value: string; label: string; disabled?: boolean }[] required The options, in the page language.
hint string — The helper line; replaced by error.
error string — The error words; sets aria-invalid.
leadingIcon string — A Material Symbols name for the 20px leading icon.
controlDir 'ltr' — 'ltr' for Latin-only values such as calling codes.
...select native attributes — name, value, onChange, required, autoComplete, and the disabled attribute.