Search the archive
Demo field. No search is submitted.
A search drawer the browser can open
CaveatA details drawer opens with Enter, Space or a click on summary, and its closed contents leave the keyboard sequence. The input becomes the next Tab stop once the drawer is open. Keep the summary as the first child and leave its marker visible so the affordance survives a missing stylesheet. Unlike a popover, this drawer pushes content down and does not promise light dismissal or Escape-to-close. It also does not move focus to the field on opening.
FallbackThe demo deliberately stops at disclosure: typing here does not search anything. For a real site, place a labelled search form in the drawer and connect it to your existing results route; do not turn the summary into a submit button. Native details already supplies expanded state, so do not add a second aria-expanded value that can drift out of sync. For an overlay rather than an in-flow drawer, use a native popover. Reference: MDN documentation.
<div class="d-searchdrawer">
<div class="d-searchdrawer-bar">
<b>Field notes</b><span>Design archive</span>
</div>
<details>
<summary>Search the archive</summary>
<div>
<label for="wc-archive-term">
Search terms</label>
<input id="wc-archive-term" type="search"
placeholder="Try: container queries">
<p>Demo field. No search is submitted.</p>
</div>
</details>
</div>
.d-searchdrawer {
width: 100%; max-width: 24rem;
color: var(--paper, #e6eaf1);
border: 1px solid #64748b;
}
.d-searchdrawer-bar {
display: flex; flex-wrap: wrap; gap: .5rem;
justify-content: space-between; padding: 1rem;
}
.d-searchdrawer-bar span { font-size: .75rem; }
.d-searchdrawer summary {
cursor: pointer; padding: .8rem 1rem;
border-top: 1px solid #64748b;
}
.d-searchdrawer details[open] summary {
color: #6fa8dc;
}
.d-searchdrawer summary:focus-visible {
outline: 2px solid currentColor;
outline-offset: -4px;
}
.d-searchdrawer details > div { padding: 1rem; }
.d-searchdrawer label { display: block; }
.d-searchdrawer input {
width: 100%; min-width: 0; margin-top: .5rem;
padding: .7rem; font: inherit;
}
.d-searchdrawer p {
font-size: .75rem; margin: .75rem 0 0;
}