Dropdown & listbox
Dropdown & listbox patterns built with StyloftCSS and native HTML.
Dropdown
A disclosure containing ordinary navigation links. Use Tab, Enter and Space; this does not claim the ARIA menu arrow-key model.
Browse library ⌄
View HTML / PlaygroundHTML source
<details class="sl-dropdown">
<summary class="sl-btn">Browse library ⌄</summary>
<nav class="sl-dropdown__items" aria-label="Library destinations">
<a href="/components/">All components</a><a href="/layouts/">Layout patterns</a
><a href="/themes/">Theme gallery</a>
</nav>
</details>HTML source · enable JavaScript for the playground7 lines · UTF-8
ReadyCtrl/⌘ + Enter to run · Scripts blocked
ListBox
A styled native listbox with real keyboard and multiple-selection behavior.
Use Ctrl/Command or Shift for multiple selection.
View HTML / PlaygroundHTML source
<div class="sl-field">
<label class="sl-label" for="ref-listbox">Select frameworks</label
><select class="sl-listbox" id="ref-listbox" multiple size="4">
<option>StyloftCSS</option>
<option>Plain CSS</option>
<option>Astro</option>
<option>HTML</option>
</select>
<p class="sl-help">Use Ctrl/Command or Shift for multiple selection.</p>
</div>HTML source · enable JavaScript for the playground10 lines · UTF-8
ReadyCtrl/⌘ + Enter to run · Scripts blocked
Classes beginning with sl- come from StyloftCSS. Examples with demo- classes also use our optional demo extension CSS ↓. Load it after the core to reproduce those details.