UTXO table
bitcoin-ui/utxo-tableFreeComponent
Semantic unspent transaction output ledger.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dennisonbertram/bitcoin-ui/main/public/r/utxo-table.jsonSource
1import type { ComponentProps } from "react";23import type { BitcoinUtxo } from "@/lib/bitcoin";4import { componentClasses } from "@/lib/utils";56import { BitcoinAmount } from "./bitcoin-amount";7import { HashDisplay } from "./hash-display";8import { ScriptBadge } from "./script-badge";9import { panelStyles, type BitcoinVisualProps } from "./shared";1011export type UtxoTableProps = Omit<ComponentProps<"div">, "children"> &12 BitcoinVisualProps & {13 utxos: BitcoinUtxo[];14 caption?: string;15 getTransactionHref?: (utxo: BitcoinUtxo) => string | undefined;16 };1718export function UtxoTable({19 utxos,20 caption = "Unspent transaction outputs",21 getTransactionHref,22 unstyled,23 className,24 ...props25}: UtxoTableProps) {26 return (27 <div28 data-slot="utxo-table"29 data-unstyled={unstyled || undefined}30 className={componentClasses(31 unstyled,32 [panelStyles, "max-w-full overflow-x-auto"],33 className,34 )}35 {...props}36 >37 <table38 className={componentClasses(39 unstyled,40 "w-full min-w-[44rem] border-collapse text-left text-sm",41 )}42 >43 <caption44 className={componentClasses(45 unstyled,46 "border-b border-[var(--color-rule)] px-4 py-3 text-left text-sm font-medium",47 )}48 >49 {caption}50 </caption>51 <thead>52 <tr53 className={componentClasses(54 unstyled,55 "border-b border-[var(--color-rule-subtle)] text-xs text-[var(--color-muted)]",56 )}57 >58 <th className={componentClasses(unstyled, "px-4 py-3 font-normal")}>59 Outpoint60 </th>61 <th className={componentClasses(unstyled, "px-4 py-3 font-normal")}>62 Script63 </th>64 <th className={componentClasses(unstyled, "px-4 py-3 font-normal")}>65 Confirmations66 </th>67 <th68 className={componentClasses(69 unstyled,70 "px-4 py-3 text-right font-normal",71 )}72 >73 Value74 </th>75 </tr>76 </thead>77 <tbody>78 {utxos.map((utxo) => (79 <tr80 key={`${utxo.txid}:${utxo.vout}`}81 data-slot="utxo-table-row"82 data-spendable={utxo.spendable}83 className={componentClasses(84 unstyled,85// … truncated
What it pulls in
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 |
