Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Semantic landmark element for search functionality. Wraps search forms and controls to provide accessibility and structural meaning.
The <search> element is a semantic landmark that identifies content related to searching or filtering. It's the recommended way to mark up search functionality, replacing the older pattern of <form role="search">.
As a landmark element, <search> allows screen reader users to quickly navigate to search functionality using landmark navigation.
<form> with appropriate labels<search> <input type="search" placeholder="Search..." aria-label="Search" /></search>
Wrap a form inside <search> for server-side search functionality.
<search> <form action="/search" method="get"> <label for="site-search" class="visually-hidden">Search</label> <input type="search" id="site-search" name="q" placeholder="Search..." /> <button type="submit">Search</button> </form></search>
Search input with button side-by-side using flexbox.
<search class="inline"> <input type="search" placeholder="Search..." aria-label="Search" /> <button type="submit">Search</button></search>
Smaller search for headers or sidebars.
<search class="compact inline"> <input type="search" placeholder="Quick search..." aria-label="Search" /> <button type="submit">Find</button></search>
Pill-shaped search input.
<search class="inline rounded"> <input type="search" placeholder="Search..." aria-label="Search" /> <button type="submit">Go</button></search>
Full-width search input.
<search class="expanded"> <input type="search" placeholder="Search the entire site..." aria-label="Search" /></search>
Constrained width for header placement.
<search class="header inline"> <input type="search" placeholder="Search..." aria-label="Search" /> <button type="submit" class="small">Go</button></search>
| Class | Description |
|---|---|
.inline |
Flexbox layout with input and button side-by-side |
.compact |
Smaller sizing for dense interfaces |
.rounded |
Pill-shaped input with full border radius |
.expanded |
Full-width search input |
.header |
Constrained max-width for header placement |
.with-icon |
Positioned icon inside the input |
search { display: block;} /* Inline variant */search.inline { display: flex; gap: var(--size-xs); & > input { flex: 1; }} /* Expanded variant */search.expanded { inline-size: 100%; & > input { inline-size: 100%; }} /* Compact variant */search.compact { & > input, & > button { padding-block: var(--size-xs); font-size: var(--font-size-sm); }} /* Rounded variant */search.rounded > input { border-radius: var(--radius-full); padding-inline: var(--size-m);}
Use GET method so search queries appear in the URL and can be bookmarked/shared.
<search> <form action="/search" method="get" class="inline"> <label for="search-products" class="visually-hidden">Search products</label> <input type="search" id="search-products" name="q" placeholder="Search products..." /> <button type="submit">Search</button> </form></search>
For client-side filtering, omit the form and handle input events directly.
<search> <input type="search" placeholder="Filter results..." aria-label="Filter results" id="filter-input" /></search> <script> const input = document.getElementById('filter-input'); input.addEventListener('input', (e) => { filterContent(e.target.value); });</script>
The <search> element is a landmark, meaning screen reader users can jump directly to it using landmark navigation. This replaces the older pattern of <form role="search">.
Always provide a label for the search input. Options include:
<label> element<label> using .visually-hiddenaria-label attribute on the input<!-- Visible label --><label for="search">Search</label><input type="search" id="search" /> <!-- Hidden label (visible to screen readers) --><label for="search" class="visually-hidden">Search</label><input type="search" id="search" /> <!-- aria-label (no visible label element) --><input type="search" aria-label="Search" />
Always use type="search" for search inputs. It provides:
If a page has multiple search regions, use aria-label to distinguish them:
<!-- Main site search --><search aria-label="Site search"> ...</search> <!-- Table filter --><search aria-label="Filter table results"> ...</search>
| Key | Action |
|---|---|
| Enter | Submit the search form (when in form context) |
| Escape | Clear the search input (browser-dependent) |
<input type="search"> - The search input element inside the search landmark<form> - For wrapping search with server submission<button> - Submit button for search forms<nav> - Another landmark element (for navigation)The <search> element is supported in all modern browsers. For older browsers, it degrades gracefully as a generic container while still functioning correctly.