FilterLiveSearch
Debounced full-text search input designed to be rendered in the sidebar of a <List> view.
Installation
pnpm dlx shadcn@latest add @shadmin/filter-live-searchUsage
<FilterLiveSearch> bundles a <FilterLiveForm> and a <SearchInput>. It binds the value of a text field to the surrounding list filters (defaulting to the q source) and triggers a search on change.
import { Card } from "@/components/ui/card";
import { FilterLiveSearch, List, DataTable } from "@/components/admin";
const FilterSidebar = () => (
<Card className="p-4">
<FilterLiveSearch />
</Card>
);
export const PostList = () => (
<List aside={<FilterSidebar />}>
<DataTable>
<DataTable.Col source="title" />
</DataTable>
</List>
);You can override the filter source and placeholder for use cases other than full-text search:
<FilterLiveSearch source="title" placeholder="Search by title" />Props
<FilterLiveSearch> accepts the same props as <SearchInput>, and additionally:
| Prop | Required | Type | Default | Description |
|---|---|---|---|---|
source | Optional | string | q | Name of the filter field bound to the input |
placeholder | Optional | string | "Search" | Placeholder text |
className | Optional | string | - | Extra Tailwind classes appended to the wrapping input |