Select
The shared select renders a visible label, an optional description, and a native <select> from option records. Its shortcode bridge lets documentation use the same partial as templates.
Example#
Choose how often to receive a summary.
When to use#
- Use a select when the reader picks one option from a list too long for a row of visible controls
- Prefer filter chips or radio buttons when the options are few; visible choices scan faster than a collapsed list
- Not for navigation — a select that changes the page on selection surprises keyboard users
Implementation#
{{ partial "select.html" (dict
"id" "update-frequency"
"name" "frequency"
"label" "Update frequency"
"description" "Choose how often to receive a summary."
"selected" "weekly"
"options" (slice
(dict "value" "daily" "label" "Daily")
(dict "value" "weekly" "label" "Weekly")
(dict "value" "monthly" "label" "Monthly")
)
) }}The partial renders the field structure and does not add JavaScript. The browser supplies keyboard operation, validation, and the platform picker. Markdown pages use the select shortcode.
Options#
| Option | Purpose |
|---|---|
id | Required unique control ID used by the label and optional description |
name | Submitted field name; defaults to id |
label | Required visible label |
description | Optional help text linked through aria-describedby |
options | Required list of value, label, selected, and disabled records |
selected | Value selected when no option record sets selected |
required | Adds native required-field validation |
disabled | Disables the complete control |
autocomplete | Optional browser autofill token |
Interface manifest
- Kind
- Component
- Category
- Action
- Status
- Implemented
- Implementation
- Partial:
layouts/partials/select.htmlShortcode:layouts/shortcodes/select.htmlCSS:assets/css/site.css - Related interfaces
- Select
Accessibility#
- The visible
<label>points to the native<select>through matchingforandidvalues - The optional description is programmatically associated through
aria-describedby - Native select keyboard behaviour and mobile pickers remain intact because the component does not rebuild the control with custom elements
- Required, disabled, selected, and disabled-option states use native HTML attributes