Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

Search

The product search: a field in the middle of the screen, with results as the person types, one per line.

On this page

Playground

Search Feitio

↵ opens the first↑↓ chooseEsc closes

Results
Background
HTML
<dialog open class="feitio-dialog search-dialog search-sample" id="pg-search" aria-labelledby="pg-search-t"><form method="dialog"><h2 id="pg-search-t" class="feitio-visually-hidden">Search Feitio</h2><div class="search-head"><svg class="feitio-icon" aria-hidden="true"><use href="/feitio/icons/sprite.svg#feitio-search"></use></svg><label class="feitio-visually-hidden" for="pg-search-field">Search Feitio</label><input class="search-field" id="pg-search-field" type="search" autocomplete="off" placeholder="Button, color…"><button type="submit" class="feitio-button close" data-size="small" value="close"><svg class="feitio-icon" aria-hidden="true"><use href="/feitio/icons/sprite.svg#feitio-close"></use></svg>Close</button></div><ul class="results"><li><a href="#playground" data-active><strong>Table</strong><small>Components</small></a></li><li><a href="#playground"><strong>Tokens</strong><small>Development</small></a></li></ul><p class="foot"><span><kbd class="feitio-kbd">↵</kbd> opens the first</span><span><kbd class="feitio-kbd">↑</kbd><kbd class="feitio-kbd">↓</kbd> choose</span><span><kbd class="feitio-kbd">Esc</kbd> closes</span></p></form></dialog>

When to use

When not to use

Examples

This site’s search

Tap the button, or press / or Ctrl + K.

Show code
HTML
<button type="button" class="feitio-button" data-open-search>…Buscar</button>
<dialog class="feitio-dialog search-dialog" aria-labelledby="busca-t">
  <form method="dialog">
    <div class="search-head">…<input class="search-field" type="search">…</div>
    <ul class="results">…</ul>
    <p class="foot">…</p>
  </form>
</dialog>

Anatomy

TableClose

↵ opens the firstEsc closes

  1. Field: with the magnifier and Close on the same line.
  2. Results: one per line, the name and the area; the first already marked.
  3. Keys: what each one does.

States

Where the results come from

The index is built when the site is published, from every page (with Pagefind, which runs without a server). In this draft, the list is written by hand.

Accessibility

Attributes

AttributeValuesWhat for
data-open-searchon the opening buttonOpens the search.
class="feitio-dialog search-dialog"on the <dialog>The search, which closes with a tap outside.
class="results"the listOne result per line.
Top