BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/agent-elements/suggestions

suggestions

agent-elements/suggestions
FreeComponent

agent-elements publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by agent-elements on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://agent-elements.21st.dev/r/suggestions.json

Source

registry/agent-elements/components/input/suggestions.tsxagent-elements.21st.dev/r/suggestions.json
1"use client";
2
3import type { ReactNode } from "react";
4import { cn } from "../utils/cn";
5
6export type SuggestionItem = {
7 id: string;
8 label: string;
9 value?: string;
10 icon?: ReactNode;
11 className?: string;
12};
13
14export type SuggestionsProps = {
15 items: SuggestionItem[];
16 onSelect: (item: SuggestionItem) => void;
17 disabled?: boolean;
18 className?: string;
19 itemClassName?: string;
20};
21
22export function Suggestions({
23 items,
24 onSelect,
25 disabled,
26 className,
27 itemClassName,
28}: SuggestionsProps) {
29 if (items.length === 0) {
30 return null;
31 }
32
33 return (
34 <div className={cn("flex flex-wrap items-center gap-2", className)}>
35 {items.map((item) => (
36 <button
37 key={item.id}
38 type="button"
39 disabled={disabled}
40 onClick={() => onSelect(item)}
41 className={cn(
42 "inline-flex h-7 items-center gap-1 rounded-[6px] border border-border bg-transparent px-2 text-sm text-an-foreground-muted transition-colors hover:bg-an-background-secondary/40 hover:text-an-foreground disabled:opacity-50 disabled:pointer-events-none",
43 itemClassName,
44 item.className,
45 )}
46 >
47 {item.icon && (
48 <span className="inline-flex shrink-0">{item.icon}</span>
49 )}
50 {item.label}
51 </button>
52 ))}
53 </div>
54 );
55}

Facts

Registry
agent-elements
Type
registry:ui
Access
Free
Files written
0
Licence
the repository states none
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on agent-elements agent-elements.21st.dev Raw registry item This item as JSON

More from agent-elements

All 25 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
agent-chatagent-chatagent-elementsComponentsFreeno deps
attachment-buttonattachment-buttonagent-elementsComponentsFreeno deps
bash-toolbash-toolagent-elementsComponentsFreeno deps
edit-tooledit-toolagent-elementsComponentsFreeno deps
error-messageerror-messageagent-elementsComponentsFreeno deps
file-attachmentfile-attachmentagent-elementsComponentsFreeno deps
generic-toolgeneric-toolagent-elementsComponentsFreeno deps
input-barinput-baragent-elementsComponentsFreeno deps
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