BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/tool-ui/approval-card

Approval Card

tool-ui/approval-card
FreeBlock

Binary confirmation for agent actions.

See it running

Open the demo on tool-ui

www.tool-ui.com/components/approval-card
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://www.tool-ui.com/r/approval-card.json

Source

components/tool-ui/approval-card/approval-card.tsxwww.tool-ui.com/r/approval-card.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { cn, Separator } from "./_adapter";
5import type { ApprovalCardProps, ApprovalDecision } from "./schema";
6import { ActionButtons } from "../shared/action-buttons";
7import { type Action } from "../shared/schema";
8
9import { icons, Check, X } from "lucide-react";
10
11type LucideIcon = React.ComponentType<{ className?: string }>;
12
13function getLucideIcon(name: string): LucideIcon | null {
14 const pascalName = name
15 .split("-")
16 .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
17 .join("");
18
19 const Icon = icons[pascalName as keyof typeof icons];
20 return Icon ?? null;
21}
22
23interface ApprovalCardReceiptProps {
24 id: string;
25 title: string;
26 choice: ApprovalDecision;
27 actionLabel?: string;
28 className?: string;
29}
30
31function ApprovalCardReceipt({
32 id,
33 title,
34 choice,
35 actionLabel,
36 className,
37}: ApprovalCardReceiptProps) {
38 const isApproved = choice === "approved";
39 const displayLabel = actionLabel ?? (isApproved ? "Approved" : "Denied");
40
41 return (
42 <div
43 className={cn(
44 "flex w-full min-w-64 max-w-md flex-col",
45 "text-foreground",
46 "motion-safe:animate-in motion-safe:fade-in motion-safe:blur-in-sm motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:fill-mode-both",
47 className,
48 )}
49 data-slot="approval-card"
50 data-tool-ui-id={id}
51 data-receipt="true"
52 role="status"
53 aria-label={displayLabel}
54 >
55 <div
56 className={cn(
57 "bg-card/60 flex w-full items-center gap-3 rounded-2xl border px-4 py-3 shadow-xs",
58 )}
59 >
60 <span
61 className={cn(
62 "flex size-8 shrink-0 items-center justify-center rounded-full bg-muted",
63 isApproved ? "text-primary" : "text-muted-foreground",
64 )}
65 >
66 {isApproved ? <Check className="size-4" /> : <X className="size-4" />}
67 </span>
68 <div className="flex flex-col">
69 <span className="text-sm font-medium">{displayLabel}</span>
70 <span className="text-muted-foreground text-sm">{title}</span>
71 </div>
72 </div>
73 </div>
74 );
75}
76
77export function ApprovalCard({
78 id,
79 title,
80 description,
81 icon,
82 metadata,
83 variant,
84 confirmLabel,
85 cancelLabel,
86 className,
87 choice,
88 onConfirm,
89 onCancel,
90}: ApprovalCardProps) {
91 const resolvedVariant = variant ?? "default";
92// … truncated

What it pulls in

npm packages

  • lucide-react
  • zod

Other registry items

  • button
  • separator

Files it writes

  • components/tool-ui/approval-card/_adapter.tsx
  • components/tool-ui/approval-card/approval-card.tsx
  • components/tool-ui/approval-card/index.tsx
  • components/tool-ui/approval-card/README.md
  • components/tool-ui/approval-card/schema.ts
  • components/tool-ui/shared/_adapter.tsx
  • components/tool-ui/shared/action-buttons.tsx
  • components/tool-ui/shared/contract.ts
  • components/tool-ui/shared/parse.ts
  • components/tool-ui/shared/schema.ts
  • components/tool-ui/shared/use-action-buttons.tsx

Facts

Registry
tool-ui
Type
registry:block
Access
Free
Files written
11
Licence
the repository states none
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on tool-ui www.tool-ui.com Raw registry item This item as JSON

More from tool-ui

All 27 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Audioaudiotool-uiBlocksFree2 deps · 9 files
Chartcharttool-uiBlocksFree2 deps · 8 files
Citationcitationtool-uiBlocksFree2 deps · 15 files
Code Blockcode-blocktool-uiBlocksFree3 deps · 11 files
Code Diffcode-difftool-uiBlocksFree3 deps · 10 files
Data Tabledata-tabletool-uiBlocksFree1 dep · 17 files
Geo Mapgeo-maptool-uiBlocksFree4 deps · 12 files
Imageimagetool-uiBlocksFree1 dep · 14 files
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