Search

A search field with a magnifier, a clear button and a loading state.
Stable
Web
iOS
Android
@advui/core
Source
JSX
<Search placeholder="Search" />
size

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Search } from '@advui/core'

<Search placeholder="Search publications" onSearch={runSearch} />

Examples

Search on Enter

Press Enter to search.

Live results

Filters as you type, with the loading spinner and a live result count.
7 townships: Hlaing Tharyar, Hakha, Hpa-An, Mawlamyine, Myitkyina, Sittwe, Taunggyi

API reference

Search

Also takes the Input props (`placeholder`, `disabled`, `id`…).
PropTypeDefaultDescription
valuestring—The text (controlled or not). Filter live from `onValueChange`.
defaultValuestring—Starting `value` when uncontrolled.
onValueChange(value: string) => void—Called with the new `value`.
onSearch(value: string) => void—Enter, or the keyboard’s search key, was pressed.
loadingbooleanfalseA spinner replaces the magnifier; sets `aria-busy`.
size'sm' | 'md' | 'lg''md'Height.
aria-labelstring'Search'Name of the field. Say what it searches.
clearLabelstring'Clear search'Name of the clear button.
landmarkbooleanfalseWraps it in a `search` landmark, for the page’s main search.Web only.

Accessibility

  • A searchbox named by aria-label (default "Search"); the icons are hidden.
  • The clear button is named "Clear search", appears only with text, and returns focus to the field.
  • While loading the field has aria-busy. Announce result counts in a polite live region, as in the Live example.
  • landmark adds a search landmark so screen-reader users can jump to it.
Keyboard interactions
KeyAction
EnterRuns `onSearch`.
EscapeClears the text (web).

Platform notes

Web
The Enter key hint is "search" on phone keyboards.
iOS
The keyboard’s return key reads "Search".
Android
Same as iOS.
Since v0.6.0Last updated Nov 2, 2026Edit this page on GitHub