Skip to content

Select

A native select dropdown with consistent styling across browsers. Uses the same token system as Input for visual consistency.

Preview

Please select a role.

Sizes

Features

  • Native <select> element for maximum compatibility and accessibility.
  • Custom chevron indicator via CSS background image.
  • Matches Input heights, borders, and focus styles.
  • Browser-native dropdown menu for option selection.

States

StateAppearance
DefaultResting with chevron indicator
FocusBrand-purple border with focus shadow
DisabledReduced opacity, no interaction
ErrorRed border with error message below

Props

PropTypeDefaultDescription
labelstring--Visible label text
helperstring--Helper text below the select
errorstring--Error message
size'sm' | 'md' | 'lg''md'Select height
disabledbooleanfalseDisables the select
placeholderstring--Placeholder option text
options{ label: string; value: string }[]--Option items

Code example

React

tsx
import { Select } from '@thepace/lexicon/components';

<Select
  label="Country"
  placeholder="Select a country"
  options={[
    { label: 'United Kingdom', value: 'uk' },
    { label: 'United States', value: 'us' },
    { label: 'Germany', value: 'de' },
  ]}
/>

Vanilla HTML

html
<div class="lex-input-wrapper">
  <label class="lex-input__label">Country</label>
  <select class="lex-select lex-select--md">
    <option value="" disabled selected>Select a country</option>
    <option>United Kingdom</option>
    <option>United States</option>
  </select>
</div>

CSS class reference

ClassPurpose
.lex-selectBase select styles
.lex-select--smSmall size
.lex-select--mdMedium size (default)
.lex-select--lgLarge size
.lex-select-wrapper--errorError state on wrapper

Accessibility

  • Label connected via htmlFor/id.
  • aria-invalid="true" when error is set.
  • aria-describedby points to helper or error text.
  • Native <select> provides built-in keyboard navigation (arrow keys, type-ahead).

Guidelines

Do

  • Include a disabled placeholder option as the first item (e.g. "Select a country").
  • Use native select for 5+ options — for 2–4 options, consider a Radio group.

Don't

  • Don't use a custom dropdown when native select provides better accessibility.
  • Don't populate with more than 20 options without a search/filter mechanism.

Released under the MIT License. A product by the pace.