Dropdown
A details.dropdown opens a menu below its summary: select-styled by default, button-styled with role="button", and inline inside a
Usage
<details class="dropdown">
<summary>Choose…</summary>
<ul>
<li><a href="#">Option</a></li>
<li><label><input type="checkbox" /> Toggle</label></li>
</ul>
</details><details class="dropdown">
<summary>Choose…</summary>
<ul>
<li><a href="#">Option</a></li>
<li><label><input type="checkbox" /> Toggle</label></li>
</ul>
</details>- The default
summarylooks like aselect(chevron,--v-form-element-*tokens,aria-invalidcolors);summary[role="button"]looks like abutton . - The menu is the
ulright after the summary: absolutely positioned,--v-dropdown-*tokens, links and labels fill each row;dir="rtl"on the list right-aligns it. - While open, an invisible full-page
::beforeon the summary closes the menu on an outside click — no JS. - Inside a
nav, the dropdown sits inline with the links; inside alabel, it aligns like a control.