Search Field
A search input with a leading magnifier and a trailing clear button that appears only while there's a value. Value is controlled via @change; pressing Enter fires @submit.
Query: —
Installation
Copy the piece into your app — it compiles with your build and the code is yours:
puzzle add piece search-field
Requires the pieces.css tokens merged into your app styles (see Introduction).
Usage
import SearchField from '@/components/ui/SearchField.pzl';
<SearchField value={ query } placeholder="Filter results…" @change={ setQuery } />Submit on Enter
Press Enter to fire a search.