Skip to content

Search Field

A search box: Escape clears it, Enter submits, a clear button out of the tab order puts the focus back.

Styled with CSS Tailwind

Search the docs

The input is a type="search" box (role="searchbox"). Escape clears the text and goes no further - a dialog around it stays open; pressed on the empty field it does what Escape does there. Enter raises OnSubmit. The clear button is named "Clear search", disabled while empty (data-empty) and returns the focus to the input.

Submitted:

An unhandled error has occurred. Reload 🗙