
Styling Native Dropdowns with CSS Customizable Select
The native HTML <select> element has long resisted visual customization. While browsers provided robust keyboard navigation, type-ahead search, screen reader semantics, and automatic viewport collision handling out of the box, styling the dropdown popover or placing rich markup such as status badges, icons, and secondary descriptions inside <option> elements was impossible. Teams routinely abandoned native controls altogether, rebuilding complex <div> and ARIA listbox widgets in JavaScript that were difficult to maintain and prone to accessibility regressions.
In 2025, CSS Customizable Select reached stable browser availability (starting in Chromium 135) as a purely progressive enhancement layered directly onto <select>. By opting in with appearance: base-select on both the select control and its ::picker(select) pseudo-element, authors unlock full CSS styling over the trigger button, the top-layer dropdown popover, the ::picker-icon indicator, and ::checkmark markers. Alongside this CSS opt-in, HTML introduced the <selectedcontent> element inside a <button> child of <select>, which automatically clones the selected <option> element's rich DOM structure into the closed trigger button while older browsers gracefully fall back to standard native rendering.
Example
<label for="env-select">Deployment Environment</label>
<select id="env-select" class="custom-select" name="environment">
<button>
<selectedcontent></selectedcontent>
</button>
<option value="prod">
<span class="dot dot-green" aria-hidden="true"></span>
<span>Production</span>
</option>
<option value="staging">
<span class="dot dot-amber" aria-hidden="true"></span>
<span>Staging</span>
</option>
</select>
/* Opt both the select trigger and its popover picker into base-select styling */
.custom-select,
.custom-select::picker(select) {
appearance: base-select;
}
.custom-select::picker(select) {
border: 1px solid #cbd5e1;
border-radius: 0.5rem;
padding: 0.25rem;
background: #ffffff;
}
Implementation
<div class="field-group">
<label class="field-label" for="plan-tier">Billing Plan</label>
<select id="plan-tier" class="tier-select" name="tier">
<button type="button">
<selectedcontent></selectedcontent>
</button>
<option value="starter">
<span class="option-row">
<span class="option-title">Starter</span>
<span class="option-meta">Up to 3 projects</span>
</span>
</option>
<option value="pro" selected>
<span class="option-row">
<span class="option-title">Pro Team</span>
<span class="option-meta">Unlimited projects and audit logs</span>
</span>
</option>
<option value="enterprise">
<span class="option-row">
<span class="option-title">Enterprise</span>
<span class="option-meta">Dedicated SSO and SLA</span>
</span>
</option>
</select>
</div>
/* ==========================================================================
CSS Customizable Select: Progressive Enhancement with base-select
========================================================================== */
.field-group {
display: grid;
gap: 0.5rem;
max-width: 22rem;
}
.field-label {
font-weight: 600;
color: #0f172a;
}
/* Baseline styles work everywhere, including non-base-select browsers */
.tier-select {
font: inherit;
padding: 0.625rem 0.875rem;
border: 1px solid #cbd5e1;
border-radius: 0.5rem;
background-color: #ffffff;
color: #0f172a;
}
@supports (appearance: base-select) {
.tier-select,
.tier-select::picker(select) {
appearance: base-select;
}
.tier-select {
display: inline-flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
width: 100%;
cursor: pointer;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tier-select:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 2px;
}
.tier-select::picker-icon {
color: #475569;
transition: transform 0.2s ease;
}
.tier-select:open::picker-icon {
transform: rotate(180deg);
}
/* Style the top-layer dropdown popover */
.tier-select::picker(select) {
margin-block-start: 0.375rem;
padding: 0.375rem;
border: 1px solid #cbd5e1;
border-radius: 0.625rem;
background: #ffffff;
box-shadow: 0 16px 32px -12px rgb(15 23 42 / 0.18);
min-inline-size: anchor-size(width);
}
.tier-select option {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
padding: 0.5rem 0.625rem;
border-radius: 0.375rem;
cursor: pointer;
}
.tier-select option:hover,
.tier-select option:focus-visible {
background-color: #f1f5f9;
}
.tier-select option:checked {
background-color: #eff6ff;
color: #1d4ed8;
}
.tier-select option::checkmark {
order: 1;
color: #1d4ed8;
}
.option-row {
display: grid;
gap: 0.125rem;
}
.option-title {
font-weight: 600;
}
.option-meta {
font-size: 0.8125rem;
color: #64748b;
}
/* Hide secondary meta inside the compact trigger button */
.tier-select selectedcontent .option-meta {
display: none;
}
}
Main Point: Opting native select controls into appearance base-select with selectedcontent delivers rich, accessible custom dropdowns while preserving built-in keyboard behavior and graceful browser fallbacks.
Credits
Photo by Ricardo Gomez Angel on Unsplash