0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Displays a clone of the currently selected option's content inside a customizable select's button trigger. Used with appearance: base-select to show rich content (icons, images, descriptions) in the closed select state.
When to Use
Inside a customizable select to show a custom trigger with rich content
When options contain images, icons, or descriptions that should be mirrored in the closed state
When you need CSS control over how the selected value displays in the button
Requirements: Only works when the browser supports appearance: base-select (Chrome 135+). In non-supporting browsers, the select falls back to its standard rendering.
How It Works
The browser automatically clones the currently selected <option>'s DOM into the <selectedcontent> element using cloneNode(). It updates whenever the selected option changes, whether the user picks one or a script sets select.value, select.selectedIndex or option.selected. No change event is needed.
Required Structure
The nesting must follow this exact pattern:
Required nesting structure
<!-- Required structure --><select><button><!-- Custom trigger --><selectedcontent></selectedcontent><!-- Cloned content appears here --></button><optionvalue="a">Option A</option><!-- Options after the button --><optionvalue="b">Option B</option></select><!-- Both opening and closing tags are mandatory --><!-- This will NOT work: <selectedcontent /> -->
<button> must be the first child of <select>
<selectedcontent> must be inside that <button>
All <option> elements come after the button
Both opening and closing tags are mandatory
Examples
Basic
A plain select with a custom trigger. The selected option text is cloned into the button automatically.
Options with emoji flags and descriptions. The .detail text is hidden in the closed trigger via CSS to keep it compact.
Rich content with selectedcontent
<selectname="language"><button><selectedcontent></selectedcontent></button><optionvalue="en"><spanaria-hidden="true">🇺🇸</span> English<spanclass="detail">— American English</span></option><optionvalue="es"><spanaria-hidden="true">🇪🇸</span> Español<spanclass="detail">— Spanish</span></option><optionvalue="fr"><spanaria-hidden="true">🇫🇷</span> Français<spanclass="detail">— French</span></option></select>
Styling
Since <selectedcontent> contains a clone of the selected option's DOM, you can target child elements to control what is visible in the closed state versus the open dropdown.
Hiding content in the trigger
/* Hide supplementary text in the closed trigger */selectedcontent .detail {display: none;}/* Hide images in the button, show only in dropdown */selectedcontent img {display: none;}
VB applies these styles automatically inside @supports (appearance: base-select):
selectedcontent gets display: flex with align-items: center and gap
selectedcontent .detail is hidden by default
The parent button fills the select width as a flex container, and is reset to a plain content slot (no padding, border, background, shadow or minimum size, even under themes)
Attributes
<selectedcontent> accepts only global HTML attributes (class, id, style, data-*, etc.). There are no element-specific attributes.
Accessibility
Inert by default: The <button> inside <select> is inert, so <selectedcontent> and its children cannot be focused or interacted with independently
Name and value: Screen readers announce the select by its <label> and the selected option's text as its value. The clone in the trigger is not announced separately
Cloned content: Decorative elements (icons, flags) in options should use aria-hidden="true" since they are cloned into the trigger as well
Keyboard navigation: Fully handled by the parent <select> — no additional keyboard handling needed
Caveats
Update triggers: The clone refreshes when the selected option changes, by user or by script (select.value = …, option.selected = true). Editing the content of the option that is already selected may not refresh the clone; re-select it (for example, set select.value again) after changing its content
Fallback: Browsers without base-select drop the <button> and <selectedcontent> and show each option's plain text, so keep option text short. See select, "Fallback Without base-select"
Implicit button: If you omit <button> and <selectedcontent>, the browser creates an implicit button that cannot be targeted with CSS type selectors
Experimental: This element is not yet Baseline — check browser support before relying on it in production
Browser Support
Requires appearance: base-select support (Chrome 135+). VB gates all related styles behind @supports, so non-supporting browsers get the standard select rendering with each option's plain text in the closed select.
Related
select — Parent element; see the Customizable Select section for the full base-select guide
option — Options whose content gets cloned into selectedcontent
optgroup — Group related options with styled section headers
button — The required parent of selectedcontent inside a customizable select
combo-box — Alternative for filterable dropdowns with full browser support