Find a document
- Project notes
- Research library
- Travel plans
3 documents found.
A rounded Material search field with a leading icon and a clear action.
3 documents found.
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { AndroidSearchBar } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/android-search-bar.
npx @noorddev/vlak-cli add android-search-bar
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/android-search-bar.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { AndroidSearchBar } from "@noorddev/vlak-react";
<AndroidSearchBar aria-label="Search documents" placeholder="Search documents" value={query} onValueChange={setQuery} />| Prop | Type | Default | Description |
|---|---|---|---|
value | string | ||
defaultValue | string | "" | |
onValueChange | (value: string) => void | ||
clearLabel | string | "Clear search" | |
containerClassName | string | ||
containerStyle | CSSProperties |
Also accepts Omit< InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "size" >.
| Keys | Does |
|---|---|
| Tab | Focuses the search field and its clear action when present. |
| Escape | Clears an editable query and keeps focus in the field. |
| Enter | Uses the enclosing form's native submit behavior. |
<div class="rs-android-search-bar"><span class="rs-android-search-icon" aria-hidden="true">⌕</span><input class="rs-android-search-input" type="search" aria-label="Search documents" placeholder="Search documents" /></div>