BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@nswds/ui/site-search

Site Search

nswds-ui/site-search
FreeComponent

Cmd/Ctrl-K site search palette on the Base UI autocomplete and dialog primitives — grouped results, keyboard filtering and an onSelect callback for framework routing.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/site-search.json

Source

src/components/site-search.tsxraw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/site-search.json · first 6 KB
1'use client'
2
3import { Autocomplete } from '@base-ui/react/autocomplete'
4import { Dialog } from '@base-ui/react/dialog'
5import React from 'react'
6
7import { IconSearch } from '@/icons/search'
8import { cn } from '@/lib/utils'
9
10import { Button } from '@/components/button'
11
12/** A single searchable destination. `keywords` extend matching beyond the title. */
13type SiteSearchItem = {
14 title: string
15 href: string
16 keywords?: string[]
17}
18
19/** A titled section of results, rendered with a muted group heading. */
20type SiteSearchGroup = {
21 title: string
22 items: SiteSearchItem[]
23}
24
25type SiteSearchProps = {
26 /** The searchable site map, as titled groups of items. */
27 groups: SiteSearchGroup[]
28 /**
29 * Called with the chosen item on click or Enter, after the palette closes.
30 * Navigation is the APP's job — call your router here (e.g. next/navigation's
31 * `router.push(item.href)`). The design system ships no framework code, so it
32 * never navigates itself; this mirrors the DS-wide framework-free rule
33 * (see `Link` / `LinkProvider`).
34 */
35 onSelect: (item: SiteSearchItem) => void
36 /** Whether the palette is open. Use when controlled. */
37 open?: boolean
38 /** Called whenever the palette asks to open or close. */
39 onOpenChange?: (open: boolean) => void
40 /** Whether the palette is initially open (uncontrolled). */
41 defaultOpen?: boolean
42 /**
43 * Wire the global Cmd/Ctrl-K toggle on `document`, with cleanup on unmount.
44 * Defaults to true. Only one shortcut-enabled SiteSearch should be mounted
45 * per page, or each press toggles all of them.
46 */
47 shortcut?: boolean
48 /**
49 * Accessible name for the palette, applied as `aria-label` to the dialog
50 * panel, the search input and the default trigger. Defaults to
51 * `'Search site'`. Mirrors ExpandableSearch's `label` prop — localise it
52 * rather than hardcoding English into consumers' pages.
53 */
54 label?: string
55 /** Placeholder for the search input. */
56 placeholder?: string
57 /** Message shown when no items match the query. */
58 emptyMessage?: string
59 /**
60 * The element that opens the palette. Defaults to a ghost icon `Button`
61 * named by `label`. Pass an element to replace it — it is composed via Base
62 * UI's `render` prop, so it inherits the trigger behaviour and ARIA — or
63 * `null` to render no trigger at all (open via `open` or the shortcut).
64 * A custom trigger owns its own accessible name — `label` is applied as
65// … truncated

What it pulls in

npm packages

  • @base-ui/react
  • clsx
  • tailwind-merge

Other registry items

  • https://ui.digital.nsw.gov.au/registry/r/theme.json
  • https://ui.digital.nsw.gov.au/registry/r/button.json
  • https://ui.digital.nsw.gov.au/registry/r/icons.json

Files it writes

  • src/components/site-search.tsx
  • src/lib/utils.ts

Facts

Registry
@nswds/ui
Type
registry:ui
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-20
Last confirmed
today

Go to the source

ui.digital.nsw.gov.au digitalnsw/nswds-ui on GitHub Raw registry item This item as JSON

More from @nswds/ui

All 46 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Aspect Ratioaspect-ratio@nswds/uiComponentsFree2 deps · 2 files
Badgebadge@nswds/uiComponentsFree4 deps · 2 files
Buttonbutton@nswds/uiComponentsFree4 deps · 2 files
Cardcard@nswds/uiComponentsFree2 deps · 2 files
Collapsiblecollapsible@nswds/uiComponentsFree1 dep
Drawerdrawer@nswds/uiComponentsFree3 deps · 2 files
Expandable Searchexpandable-search@nswds/uiComponentsFree3 deps · 2 files
Fieldfield@nswds/uiComponentsFree4 deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored on what can be checked

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex