A search page contains many components and elements documented elsewhere. This page is about how to put them together, the hierarchy of content, and other design considerations when building a search form and results page.
Before a search, the form is the primary content so it sits on the default page ground (white in light mode). Tips for searching are secondary content and sit in a tinted band below it.
Search tips
How to search by author, by category, with wildcards and phrases.
<div class="ds-container">
<h1>Search</h1>
<form class="ds-form--compact" method="get" action="search.html" role="search" aria-label="Search arXiv">
<div class="ds-input-group">
<label class="is-sr-only" for="sq1">Search term</label>
<input class="ds-input" id="sq1" name="query" type="search" value="">
<label class="is-sr-only" for="sf1">Field to search</label>
<select class="ds-input" id="sf1" name="searchtype"><option>All fields</option><option>Title</option><option>Author(s)</option><option>Abstract</option></select>
</div>
<button class="ds-btn ds-btn-primary" type="submit">Search</button>
<label class="ds-check"><input type="checkbox" name="abstracts" value="show" checked><span>Show abstracts</span></label>
<a href="search.html">Advanced search</a>
</form>
<div class="ds-full ds-zone-secondary">
<p><strong>Search tips</strong></p>
<p>How to search by author, by category, with wildcards and phrases.</p>
</div>
</div>
After a search, the form stays where it was, on the page ground. A heading names the query, and tinted bars with the range and page numbers bookend the results.
Search shows the first 10,000 results. To see the rest, narrow the search.
<div class="ds-container">
<h1>Search</h1>
<form class="ds-form--compact" method="get" action="search.html" role="search" aria-label="Search arXiv">
<div class="ds-input-group">
<label class="is-sr-only" for="sq2">Search term</label>
<input class="ds-input" id="sq2" name="query" type="search" value="lensing">
<label class="is-sr-only" for="sf2">Field to search</label>
<select class="ds-input" id="sf2" name="searchtype"><option>All fields</option><option>Title</option><option>Author(s)</option><option>Abstract</option></select>
</div>
<button class="ds-btn ds-btn-primary" type="submit">Search</button>
<label class="ds-check"><input type="checkbox" name="abstracts" value="show" checked><span>Show abstracts</span></label>
<div class="ds-filter"><label for="so2">Sort by</label><select id="so2" name="order"><option>Newest announced</option><option>Relevance</option></select></div>
<div class="ds-filter"><label for="sp2">Per page</label><select id="sp2" name="size"><option>25</option><option selected>50</option><option>100</option></select></div>
<a href="search.html">Advanced search</a>
</form>
<section aria-labelledby="results">
<h2 id="results">Results for “lensing”</h2>
<div class="ds-alert" role="status"><p>Search shows the first 10,000 results. To see the rest, narrow the search.</p></div>
<nav class="ds-pagination ds-pagination--top" aria-label="Search results pages">
<span class="ds-pagination-position">1–50 of 18,659 results</span>
<a class="ds-btn ds-btn-text is-disabled" aria-disabled="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></a>
<ol class="ds-pagination-pages">
<li><a href="?page=1" aria-current="page"><span class="is-sr-only">Page </span>1</a></li>
<li><a href="?page=2"><span class="is-sr-only">Page </span>2</a></li>
<li><a href="?page=3"><span class="is-sr-only">Page </span>3</a></li>
<li><a href="?page=4"><span class="is-sr-only">Page </span>4</a></li>
<li><a href="?page=5"><span class="is-sr-only">Page </span>5</a></li>
<li>…</li>
<li><a href="?page=374"><span class="is-sr-only">Page </span>374</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=2"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
<ol class="demo-list">
<li>The first result</li>
<li>The last result on this page</li>
</ol>
<nav class="ds-pagination ds-pagination--bottom" aria-label="Search results pages, below the list">
<span class="ds-pagination-position">1–50 of 18,659 results</span>
<a class="ds-btn ds-btn-text is-disabled" aria-disabled="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></a>
<ol class="ds-pagination-pages">
<li><a href="?page=1" aria-current="page"><span class="is-sr-only">Page </span>1</a></li>
<li><a href="?page=2"><span class="is-sr-only">Page </span>2</a></li>
<li><a href="?page=3"><span class="is-sr-only">Page </span>3</a></li>
<li><a href="?page=4"><span class="is-sr-only">Page </span>4</a></li>
<li><a href="?page=5"><span class="is-sr-only">Page </span>5</a></li>
<li>…</li>
<li><a href="?page=374"><span class="is-sr-only">Page </span>374</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=2"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
</section>
</div>
role="search" and an aria-label.<title> names the query and the number of results, so a screen reader announces both when the page loads.<mark>. See Search-matched words.