Merkle proof
bitcoin-ui/merkle-proofFreeComponent
Readable transaction-to-root Merkle proof path.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dennisonbertram/bitcoin-ui/main/public/r/merkle-proof.jsonSource
1import { CornerDownRight, ShieldCheck } from "lucide-react";2import type { ComponentProps } from "react";34import { componentClasses } from "@/lib/utils";56import { HashDisplay } from "./hash-display";7import { panelStyles, type BitcoinVisualProps } from "./shared";89export interface MerkleProofNode {10 hash: string;11 side: "left" | "right";12}1314export type MerkleProofProps = Omit<ComponentProps<"section">, "children"> &15 BitcoinVisualProps & {16 transactionId: string;17 merkleRoot: string;18 proof: MerkleProofNode[];19 verified?: boolean;20 };2122export function MerkleProof({23 transactionId,24 merkleRoot,25 proof,26 verified,27 unstyled,28 className,29 ...props30}: MerkleProofProps) {31 return (32 <section33 data-slot="merkle-proof"34 data-state={verified ? "verified" : "unverified"}35 data-unstyled={unstyled || undefined}36 aria-label="Merkle proof"37 className={componentClasses(38 unstyled,39 [panelStyles, "grid min-w-0 gap-5 p-5"],40 className,41 )}42 {...props}43 >44 <header45 className={componentClasses(46 unstyled,47 "flex items-center justify-between gap-4",48 )}49 >50 <h3 className={componentClasses(unstyled, "text-sm font-medium")}>51 Merkle proof52 </h3>53 {verified ? (54 <span55 className={componentClasses(56 unstyled,57 "inline-flex items-center gap-1.5 text-xs font-medium text-[var(--color-success)]",58 )}59 >60 <ShieldCheck aria-hidden="true" className="size-3.5" />61 Verified62 </span>63 ) : null}64 </header>65 <div>66 <p67 className={componentClasses(68 unstyled,69 "mb-1 text-xs text-[var(--color-muted)]",70 )}71 >72 Transaction73 </p>74 <HashDisplay75 value={transactionId}76 label="Transaction ID"77 unstyled={unstyled}78 />79 </div>80 <ol81 data-slot="merkle-proof-path"82 className={componentClasses(83 unstyled,84 "m-0 grid list-none gap-2 border-l border-[var(--color-rule)] p-0 pl-4",85 )}86 >87 {proof.map((node, index) => (88 <li89 key={`${node.hash}-${index}`}90 className={componentClasses(91 unstyled,92 "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-2",93 )}94 >95 <span96// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from bitcoin-ui
All 23 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Address displayaddress-display | bitcoin-ui | Components | Free | no deps | |
| Bitcoin amountbitcoin-amount | bitcoin-ui | Components | Free | no deps | |
| Bitcoin motionbitcoin-motion | bitcoin-ui | Components | Free | no deps · 2 files | |
| Bitcoin searchbitcoin-search | bitcoin-ui | Components | Free | 1 dep | |
| Block cardblock-card | bitcoin-ui | Components | Free | 1 dep | |
| Block listblock-list | bitcoin-ui | Components | Free | no deps | |
| Confirmation progressconfirmation-progress | bitcoin-ui | Components | Free | no deps | |
| Difficulty adjustmentdifficulty-adjustment | bitcoin-ui | Components | Free | no deps |
