Components / Docs

DocsSearch

Title search over a static page list, opened with ⌘K, with arrow-key navigation.

OriginNew in the system

Import

tsx
import { DocsSearch } from "@somnia-chain/ui"
// in a Next.js app, internal links use next/link:
import { DocsSearch } from "@somnia-chain/ui/next"

Examples

Search five pages

examples/docs-search/default.tsxShow code
tsx
import { DocsSearch } from "@somnia-chain/ui"

export default function DocsSearchExample() {
  return (
    <div className="flex min-h-56 justify-start">
      <DocsSearch
        placeholder="Try “oracle” or “wallet”"
        entries={[
          { href: "#", title: "Ask a question", section: "Data & Truth" },
          { href: "#", title: "Oracle templates", section: "Data & Truth" },
          { href: "#", title: "Connect a wallet", section: "Get started" },
          { href: "#", title: "Session accounts", section: "Agents & Automation" },
          { href: "#", title: "Place an order", section: "Markets" },
        ]}
      />
    </div>
  )
}

Props

DocsSearch

PropTypeDefaultDescription
entries{ href, title, section?, summary? }[]—Searchable pages. Summary is matched but not shown.
placeholderstring"Search"Input placeholder.