Search With Results

Search field with a results list below it showing titles and optional subtitles, plus a No results state. Emits onSearch as you type so you can filter in React.

src/registry/ui/search-with-results.tsx/r/search-with-results.json

Installation#

bash
npx shadcn@latest add @minidev/search-with-results

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/search-with-results.json

Usage#

tsx
import { SearchWithResults } from "@/components/ui/search-with-results"

export function Example() {
  return <SearchWithResults />
}

API reference#

SearchWithResults props
PropTypeDefault
resultsSearchResult[]SAMPLE_RESULTS
onSearch(q: string) => void-
classNamestring-

Dependencies#

npm

React only

Built from

All form components

Learn more