Directory Toolbar
Search input with animated filter pills and sort dropdown for content directory pages.
Features
- Animated filter pills — Sliding highlight indicator between options
- Debounced search — 400ms debounce on URL param updates
- Sort dropdown — Optional sort with Select component
- URL-driven state — Pushes filter/search/sort to URL params
- Two layouts — Stacked or inline arrangement
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| filters | { value: string; label: string }[] | - | Filter pill options (first is 'All') |
| sortOptions | { value: string; label: string }[] | - | Sort dropdown options |
| searchPlaceholder | string | "Search..." | Search input placeholder |
| totalDocs | number | - | Total result count |
| resultLabel | string | "results" | Label for results |
| layout | "stacked" | "inline" | "stacked" | Pills below or beside search |
Components Used
inputbuttonselect