Component reference
SearchInput
A text input for search, with a search icon.
Preview
Recognition, filtering, and returning
The shared search input's icon, focus, and form semantics. Search the local samples below; clearing the query restores all results. No service is accessed.
render: () => (
<div className="workshop-stack workshop-constrained">
<Field
label="Search in the current project"
htmlFor="sample-search"
description="Try searching for theme or component. Results come only from the three local items below."
>
<SearchInput
id="sample-search"
name="query"
label="Search in the current project"
placeholder="Enter a word from the title…"
/>
</Field>
<section aria-label="Search results" className="workshop-search-results">
{[
["Component usage guide", "12 basic components · local sample"],
["Theme design notes", "MeowUI light and dark appearance · local sample"],
["Icon catalog", "32 functional glyphs · local sample"],
].map(([title, detail]) => (
<article data-search-title={title}>
<h3>{title}</h3>
<p>{detail}</p>
</article>
))}
<p data-search-empty hidden>
No matching titles; try a shorter word.
</p>
</section>
<Note role="status" data-search-count>
3 local results
</Note>
<section className="workshop-stack" aria-label="Other search states">
<Field
label="Scope locked"
htmlFor="locked-query"
description="Read-only text can still be selected and copied."
>
<SearchInput id="locked-query" label="Scope locked" value="packages/meowtail" readOnly />
</Field>
<Field label="Waiting for index" htmlFor="pending-query">
<SearchInput
id="pending-query"
label="Waiting for index"
placeholder="Search becomes available after indexing"
disabled
/>
</Field>
<Field
label="Query format"
htmlFor="invalid-query"
error="This sample accepts title text only; remove the filter expression."
>
<SearchInput id="invalid-query" label="Query format" value="type:" />
</Field>
</section>
</div>
)Installation
bun add meowtail
Usage
Taken from the examples on this page.
import { SearchInput } from "meowtail";
<SearchInput
id="sample-search"
name="query"
label="Search in the current project"
placeholder="Enter a word from the title…"
/>API reference
Native search editing and form semantics; filtering belongs to the consumer.
Props
| Prop | Type | Default |
|---|---|---|
labelRequiredAccessible name; placeholder text is only a hint. | string | – |
value | MaybeSignal<string> | – |
name | string | – |
disabled | boolean | – |
readOnly | boolean | – |
onInput | (event: Event) => void | – |
inputClassName | string | – |
Also takes className, children and the attributes and events of its root element.
DOM parts
rooticoncontrol
Registry
The component is registered as search-input in the meowtail component registry.