Dmitry

Search Panel

Component

About

Versatile search component with 5 variants: instant search, command palette, scoped search, contextual suggestions, and federated multi-source search. From GooseUI (goosen-x/gooseui), MIT.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Search Panel to your project and fits it to your theme.

Code

How Search Panel is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { Clock, Flame } from "lucide-react"
import * as React from "react"
import { SearchPanel, SearchPanelResults, type SearchResult, type SearchResultGroup } from "@/components/ui/gooseui-search-panel"

const CATALOG: SearchResult[] = [
  { id: "button", title: "Button", category: "Components" },
  { id: "carousel", title: "Carousel", category: "Components" },
  { id: "morphing-dialog", title: "Morphing Dialog", category: "Components" },
  { id: "searchbar", title: "Searchbar", category: "Components" },
  { id: "tabs", title: "Tabs", category: "Components" },
  { id: "marquee", title: "Marquee", category: "Components" },
]

const popularGroup: SearchResultGroup = {
  id: "popular",
  label: "Popular",
  icon: <Flame className="size-3" />,
  items: CATALOG,
}
const recentGroup: SearchResultGroup = {
  id: "recent",
  label: "Recent searches",
  icon: <Clock className="size-3" />,
  items: ["carousel", "tooltip", "hook"].map((text, i) => ({
    id: `recent-${i}`,
    title: text,
    query: text,
  })),
}

export default function SearchPanelDemo() {
  const [query, setQuery] = React.useState("")
  const search = React.useMemo(() => {
    const q = query.trim().toLowerCase()
    return q ? CATALOG.filter((item) => item.title.toLowerCase().includes(q)) : []
  }, [query])

  return (
    <div className="mx-auto w-full max-w-xl">
      <SearchPanel
        variant="instant"
        placeholder="Search GooseUI: carousel, button, hook…"
        size="full"
        onQueryChange={setQuery}
      >
        <SearchPanelResults
          results={search}
          defaultResults={[popularGroup, recentGroup]}
          emptyMessage="Nothing found"
        />
      </SearchPanel>
    </div>
  )
}

Dependencies

More by Dmitry

View all
  • Border Beam

    Border Beam

    156
  • Features Grid

    Features Grid

    104
  • Rating

    Rating

    1
  • Tap Coin

    Tap Coin

  • Header — Magazine

    Header — Magazine

  • Header — Mega Menu

    Header — Mega Menu

  • Header — Morphing

    Header — Morphing

  • Morphing Header

    Morphing Header