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…
A placeholder option, a pre-selected option, a disabled option, the labelattribute, and options as datalist suggestions.
Value vs Display Text
The valueattribute is what gets submitted to the server. The text content between the tags is what users see in the dropdown. If value is omitted, the text content serves as both.
Value vs display text
<!-- value="US" is submitted; "United States" is displayed --><optionvalue="US">United States</option><!-- If no value attribute, the text content is both submitted and displayed --><option>United States</option>
Display text that replaces the element's text content
In a select it is what the user sees; in a datalist browsers show it alongside (or instead of) the value
Placeholder Pattern
Make the first option a prompt with an empty value and put required on the select. HTML treats that first empty option as the select's placeholder: the select stays invalid until the user picks a real option, so the form cannot be submitted with the prompt chosen.
The prompt only counts when it is the first option, has an empty value, is not inside an optgroup, and the select is a single-row dropdown (no multiple, size of 1 or absent). Adding disabled as well stops users re-choosing the prompt once they have picked something; it is optional, as validation works either way.
Placeholder option pattern
<!-- Placeholder: first option, empty value; required on the select --><selectrequired><optionvalue="">Choose a category...</option><optionvalue="tech">Technology</option><optionvalue="design">Design</option></select>
Pre-selected Option
Use the selectedattribute to set a default value. Without it, a single-row select starts on its first option that is not disabled; a multiple select or one with size greater than 1 starts with nothing selected.
Options in datalist provide autocomplete suggestions for text inputs. The labelattribute adds descriptive context alongside the value.
Options in datalist
<inputtype="text"list="airports" /><datalistid="airports"><optionvalue="JFK"label="New York - John F. Kennedy"></option><optionvalue="LAX"label="Los Angeles International"></option><optionvalue="ORD"label="Chicago O'Hare"></option></datalist>
Styling
Classic select
In browsers without customizable select, and in every listbox select (multiple, or size greater than 1), the option list is drawn by the browser or the operating system. VB styles the parent select; options keep the platform look.
Option backgrounds and text colours cannot be styled reliably
Icons and images inside options are not rendered
Font styling may work but varies by browser and OS
Where appearance: base-select is supported, VB turns it on for single-row selects and styles the options in the picker: padded rows with rounded corners, a hover fill on options that are not disabled, the checked option in the interactive colour with a ::checkmark, and rich HTML content (images, icons) laid out with flex. The checked option's content is cloned into the selectedcontent trigger. In forced-colors mode the hovered option uses Highlight and disabled options GrayText. See the select customizable select section for details.
Accessibility
Descriptive text: Option text should clearly describe the choice
Logical order: Order options in a predictable sequence (alphabetical, numerical, by frequency)
Keyboard navigation: Arrow keys move through options; typing jumps to matching text
Screen reader support: Options are announced with their position in the list; disabled options are announced as unavailable
Don't rely on rich content: Images and icons in a customizable select's options are decoration. Keep the option's text meaningful on its own and mark decorative images with alt="" or aria-hidden="true"