Skip to content

Search field

In review
Live · web

Live search: type to filter, Enter submits, ✕ / Esc clears

6 results

nockerl-design · docs siteStreaming · 2 tools running
api-server · gateway refactorIdle · last active 12m ago
credential-store · allowlist auditNeeds attention · approval required
dueydo · failed deployError · build exited 1
nockerl-voice · dictation historyIdle · macOS menu bar
nockerl-dashboard · inbox syncStreaming · push delivered

Variants: shortcut hint, pill shape, compact toolbar size

Recents, loading & disabled. Focus the first to see recent searches

Filtering 6 of 6 sessions · submitted 0 times. The island is live.

// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform. Spec + live demo,
// not yet exported from @dizyx/nockerl-react; promotion is tracked.)
export function SessionFilter() {
const [query, setQuery] = useState('');
const results = sessions.filter((s) => s.name.toLowerCase().includes(query.toLowerCase()));
return (
<>
<SearchField
label="Search sessions"
value={query}
onValueChange={setQuery} // filters in place on every keystroke
onSubmit={runSearch} // explicit submit on Enter
placeholder="Search sessions…"
shortcut="⌘K" // inline key hint; Esc / the ✕ clears
recents={recentQueries} // optional dropdown when focused + empty
onPickRecent={setQuery}
/>
{results.length === 0 ? <NoMatches query={query} /> : <SessionList rows={results} />}
</>
);
}
PropTypeDefaultDescription
label *stringAccessible name for the searchbox (there is no persistent visible label). Sets aria-label.
value *stringCurrent query (controlled).
onValueChange(value: string) => voidFires on every keystroke; the host filters its content live.
onSubmit(value: string) => voidFires on Enter with the current query (explicit submit).
placeholderstring'Search…'Ghost prompt inside the well, supplementary and never the label.
shape'control' | 'pill''control'12px control rectangle (default) or full-stadium pill for toolbars / the input bar.
size'md' | 'sm''md'Control height: md (44px) or a compact sm (36px) for dense toolbars.
shortcutstringInline keyboard hint pinned right (e.g. ⌘K or /). Hidden once the query is non-empty.
loadingbooleanfalseShows the searching spinner and sets aria-busy (async source in flight).
disabledbooleanfalseInert and clearly seen (never faded to invisible).
recentsstring[]Recent searches; when focused + empty they drop under the field (arrow-navigable).
onPickRecent(value: string) => voidReplay a recent query (the row sets the value + runs the search; it never selects a value).