BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/patchui/search-suggestions

Search Suggestions

patchui/search-suggestions
FreeBlock

patchui publishes no description for this item.

Install it

npx shadcn@latest add https://ui.hotfix.jobs/r/search-suggestions.json

Source

registry/blocks/search-suggestions/index.tsxui.hotfix.jobs/r/search-suggestions.json · first 6 KB
1"use client";
2
3import { MagnifyingGlass, X } from "@phosphor-icons/react/dist/ssr";
4import { useId, useMemo, useRef, useState } from "react";
5import type * as React from "react";
6import { cn } from "@/lib/utils";
7import {
8 coarseTarget,
9 itemGroupLabel,
10 itemRow,
11 selectionFocus,
12} from "@/lib/recipes";
13import { Button } from "@/components/ui/button";
14import { Input } from "@/components/ui/input";
15import {
16 Popover,
17 PopoverContent,
18 PopoverTrigger,
19} from "@/components/ui/popover";
20import { Spinner } from "@/components/ui/spinner";
21import {
22 MOBILE_MEDIA_QUERY,
23 useMediaQuery,
24} from "../../hooks/use-media-query";
25
26export interface SearchSuggestion {
27 id: string;
28 label: React.ReactNode;
29 value: string;
30 description?: React.ReactNode;
31 icon?: React.ReactNode;
32 suffix?: React.ReactNode;
33 disabled?: boolean;
34 /**
35 * When set, the row renders a trailing remove control for dismissable
36 * entries in an action layer outside the listbox, so the option stays
37 * atomic and the control remains visible for touch.
38 */
39 onRemove?: () => void;
40 /** Accessible label for the remove control, e.g. `Remove "<entry>"`. */
41 removeLabel?: string;
42 onAction?: () => void;
43 actionLabel?: string;
44 actionIcon?: React.ReactNode;
45}
46
47export interface SearchSuggestionSection {
48 id: string;
49 label?: React.ReactNode;
50 suggestions: SearchSuggestion[];
51}
52
53export interface SearchSuggestionsField {
54 id: string;
55 label: string;
56 placeholder?: string;
57 value: string;
58 icon?: React.ReactNode;
59 sections: SearchSuggestionSection[];
60 loading?: boolean;
61 emptyContent?: React.ReactNode;
62}
63
64export interface SearchSuggestionsProps
65 extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSubmit"> {
66 fields: SearchSuggestionsField[];
67 activeField?: string;
68 defaultActiveField?: string;
69 open?: boolean;
70 defaultOpen?: boolean;
71 onOpenChange?: (open: boolean) => void;
72 onActiveFieldChange?: (fieldId: string) => void;
73 onFieldValueChange: (fieldId: string, value: string) => void;
74 onSuggestionSelect: (
75 fieldId: string,
76 suggestion: SearchSuggestion,
77 ) => void;
78 onSubmit: (values: Record<string, string>) => void;
79 submitLabel?: string;
80}
81
82/** Coordinated multi-field search with an anchored desktop panel and centered mobile panel. */
83export function SearchSuggestions({
84 fields,
85 activeField: controlledActiveField,
86 defaultActiveField,
87 open: controlledOpen,
88 defaultOpen = false,
89 onOpenChange,
90 onActiveFieldChange,
91// … truncated

What it pulls in

npm packages

  • @phosphor-icons/react

Other registry items

  • https://ui.hotfix.jobs/r/button.json
  • https://ui.hotfix.jobs/r/input.json
  • https://ui.hotfix.jobs/r/popover.json
  • https://ui.hotfix.jobs/r/recipes.json
  • https://ui.hotfix.jobs/r/spinner.json
  • https://ui.hotfix.jobs/r/tokens.json
  • https://ui.hotfix.jobs/r/utils.json

Files it writes

  • registry/blocks/search-suggestions/index.tsx

Facts

Registry
patchui
Type
registry:block
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

ui.hotfix.jobs hotfix-jobs/patch-ui on GitHub Raw registry item This item as JSON

More from patchui

All 51 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
App Headerapp-headerpatchuiBlocksFree1 dep
DropzonedropzonepatchuiBlocksFree1 dep
Filter Toolbarfilter-toolbarpatchuiBlocksFree1 dep
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex