select component
Drop-in semantic component. See examples, sizes, variants, and source.
Native HTML <select> wrapped in
select-wrapper for consistent chrome and a
chevron indicator. Pair with select-label and
select-helper for labelled fields. Behavior
and accessibility enhancements are auto-mounted by
select.js.
Native Select Component
Basic Select - Simple and Accessible
Choose an option
Select…
Option One
Option Two
Option Three
Option Four
This is a helper text for the select
<div class="stack">
<label class="select-label" for="basic-select">Choose an option</label>
<div class="select-wrapper max-w-xs">
<select id="basic-select">
<option value="" disabled selected>Select…</option>
<option value="1">Option One</option>
<option value="2">Option Two</option>
<option value="3">Option Three</option>
<option value="4">Option Four</option>
</select>
<svg class="chevron" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<p class="select-helper">This is a helper text for the select</p>
</div>
Select with Label and Required Field
Country *
Select country...
United States
United Kingdom
Canada
Australia
Please select your country of residence
<div class="stack">
<label class="select-label max-w-xs"> Country <span class="required">*</span> </label>
<div class="select-wrapper max-w-xs">
<select required>
<option value="" disabled selected>Select country...</option>
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
<option value="ca">Canada</option>
<option value="au">Australia</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<p class="select-helper">Please select your country of residence</p>
</div>
Select Sizes - Five Standard Sizes
Tiny (28px)
Tiny select...
Extra Small
Small
Medium
Small (32px)
Small select...
Extra Small
Small
Medium
Default (40px)
Default select...
Extra Small
Small
Medium
Large (48px)
Large select...
Extra Small
Small
Medium
Big (56px)
Big select...
Extra Small
Small
Medium
<div class="stack">
<div>
<label class="select-label text-xs">Tiny (28px)</label>
<div class="select-wrapper xs max-w-xs">
<select>
<option value="" disabled selected>Tiny select...</option>
<option value="xs">Extra Small</option>
<option value="s">Small</option>
<option value="m">Medium</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
<div>
<label class="select-label text-sm">Small (32px)</label>
<div class="select-wrapper sm max-w-xs">
<select>
<option value="" disabled selected>Small select...</option>
<option value="xs">Extra Small</option>
<option value="s">Small</option>
<option value="m">Medium</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
<div>
<label class="select-label">Default (40px)</label>
<div class="select-wrapper max-w-xs">
<select>
<option value="" disabled selected>Default select...</option>
<option value="xs">Extra Small</option>
<option value="s">Small</option>
<option value="m">Medium</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
<div>
<label class="select-label text-base">Large (48px)</label>
<div class="select-wrapper xl max-w-xs">
<select>
<option value="" disabled selected>Large select...</option>
<option value="xs">Extra Small</option>
<option value="s">Small</option>
<option value="m">Medium</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
<div>
<label class="select-label text-lg">Big (56px)</label>
<div class="select-wrapper lg max-w-xs">
<select>
<option value="" disabled selected>Big select...</option>
<option value="xs">Extra Small</option>
<option value="s">Small</option>
<option value="m">Medium</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
</div>
Select States - Visual Feedback
Error State
Select…
Option 1
Option 2
This field is required
Success State
Select…
Successfully Selected
Option 2
Valid selection
Warning State
Please reconsider...
Safe Option
Risky Option
Please review
Disabled State
Field is disabled
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="select-label">Error State</label>
<div class="select-wrapper error max-w-xs">
<select>
<option value="" disabled selected>Select…</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<p class="select-helper">This field is required</p>
</div>
<div>
<label class="select-label">Success State</label>
<div class="select-wrapper success max-w-xs">
<select>
<option value="">Select…</option>
<option value="1" selected>Successfully Selected</option>
<option value="2">Option 2</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<p class="select-helper">Valid selection</p>
</div>
<div>
<label class="select-label">Warning State</label>
<div class="select-wrapper warning max-w-xs">
<select>
<option value="" disabled selected>Please reconsider...</option>
<option value="1">Safe Option</option>
<option value="2">Risky Option</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<p class="select-helper">Please review</p>
</div>
<div>
<label class="select-label">Disabled State</label>
<div class="select-wrapper max-w-xs">
<select disabled>
<option value="" disabled selected>Disabled Select</option>
<option value="1">Option 1</option>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<p class="select-helper">Field is disabled</p>
</div>
</div>
Grouped Options - Organized Categories
Select a Country
Select country…
United States
Canada
Mexico
United Kingdom
Germany
France
Spain
Japan
China
India
<div class="stack">
<label class="select-label">Select a Country</label>
<div class="select-wrapper max-w-xs">
<select>
<option value="" disabled selected>Select country…</option>
<optgroup label="North America">
<option value="us">United States</option>
<option value="ca">Canada</option>
<option value="mx">Mexico</option>
</optgroup>
<optgroup label="Europe">
<option value="uk">United Kingdom</option>
<option value="de">Germany</option>
<option value="fr">France</option>
<option value="es">Spain</option>
</optgroup>
<optgroup label="Asia">
<option value="jp">Japan</option>
<option value="cn">China</option>
<option value="in">India</option>
</optgroup>
</select>
<svg class="chevron" viewBox="0 0 24 24">
<path
d="M7 10l5 5 5-5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
Multiple Selection - Select Multiple Options
Select Technologies
JavaScript
TypeScript
React
Vue
Angular
Svelte
Hold Ctrl/Cmd to select multiple options
<div class="stack">
<label class="select-label">Select Technologies</label>
<div class="select-wrapper max-w-xs">
<select multiple size="5">
<option value="js">JavaScript</option>
<option value="ts">TypeScript</option>
<option value="react">React</option>
<option value="vue">Vue</option>
<option value="angular">Angular</option>
<option value="svelte">Svelte</option>
</select>
</div>
<p class="select-helper">Hold Ctrl/Cmd to select multiple options</p>
</div>
Class API Reference
Type
Class
Usage
Notes
Base
select-wrapper
Container around a native <select> + chevron
Always required
select-label
Label text above the select
Use a nested required for the asterisk
select-helper
Helper / hint text below the select
Adopts state colors when wrapper has error/success/warning
Sizes
xs
28px height — tiny
Modifier on select-wrapper
sm
32px height — small
Modifier on select-wrapper
(default)
40px height — medium
No size class needed
xl
48px height — large
Modifier on select-wrapper
lg
56px height — big
Modifier on select-wrapper
States
error
Red border + red focus ring
Modifier on select-wrapper
success
Green border + green focus ring
Modifier on select-wrapper
warning
Yellow border + yellow focus ring
Modifier on select-wrapper
disabled
Disabled appearance
Use the disabled attribute on the <select> instead
Layout
full-width
Wrapper expands to 100% width
Modifier on select-wrapper
rounded-none
Square corners on the select
Modifier on select-wrapper
rounded-full
Pill-shaped select
Modifier on select-wrapper
Wrapper
chevron
The dropdown indicator SVG inside the wrapper
Auto-positioned absolutely on the right