Select <select>
Selects are used to pick a single option from a dropdown list. Commonly used in forms for choosing categories, countries, or any predefined set of values.
HTML tag
<select>⏣Native HTML
⬡Progressive
◇Custom
⬢Shadow DOM
Native HTML Element
Options
Code
html
<select class="l-select">
<button class="l-button">
<selectedcontent> </selectedcontent>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
>
<path
fill="currentColor"
d="m7 10l5 5l5-5z"
/>
</svg>
</button>
<option class="l-select-item">
<span class="option-text">Item 1</span>
</option>
<option class="l-select-item">
<span class="option-text">Item 2</span>
</option>
<option class="l-select-item">
<span class="option-text">Item 3</span>
</option>
</select>Accessibility
Criteria
- Disabled state
Native
disabledattribute prevents interaction and announces as disabledWCAG4.1.2
Keyboard interactions
API reference
Importing
css
@import 'luxen-ui/css/select';Attributes & Properties
disabledAttribute- Disables the select
requiredAttribute- Marks the field as required
multipleAttribute- Allows multiple selections
Events
changeEvent- Fired when the selected option changes
inputEvent- Fired when the selection changes (same as
changefor<select>)
CSS classes
.l-selectClass- Base select element with
appearance: base-select .l-select-itemClass- Option styling with checkmark indicator
CSS custom properties
--radiusName- Border radius (default: 4px)
--border-colorName- Border color (adapts to light/dark)