277
A search that comes up empty: it repeats the query, suggests the spelling fix, names the filter that is hiding matches and offers popular searches. Removing a filter springs the results back in.
akano results·empty search·did you mean
Run this in any project set up for the shadcn CLI. It copies the No Results source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/no-results.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { NoResults } from "@/components/no-results";
export default function Page() {
return <NoResults />;
}A free React component in the Empty & Error collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the No Results source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| items | SearchItem[] | [] |
| filters | SearchFilter[] | [] |
| defaultQuery | string | "" |
| defaultFilters | string[] | [] |
| popular | string[] | [] |
| placeholder | string | "Search docs, specs and sheets" |
| kindIcons | Record<string, LucideIcon> | defaultIcons |
| onSelect | (item: SearchItem) => void | — |
| className | string | — |