Payments Table

Every charge with customer, status, card and amount; status tabs, totals and refunds in bulk.

PROGet Payments Table and 168 other Pro components with pro lifetime — Get Pro

Category
Data Tables
Access
Pro
Source
221 lines · one file
States
7 drawn
Kind
Block

The decision inside it

The total is what you can see

Switch to Succeeded and the totals row is money that arrived, not money that was asked for. Refund in the bulk bar counts only the payments it can refund.

When to use it

Use Payments Table for a list of charges: customer, status, card and amount, with status tabs and counts, a totals row for what is shown, and Export and Refund in the bulk bar. Amounts are integer cents. For one customer's invoices use Invoice History.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Payments Table for this.
Install it: npx shadcn@latest add @liro/payments-table
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/payments-table.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/payments.tsx
import { PaymentsTable, type Payment } from "@/components/ui/payments-table";

export function Payments({ rows, loading }: { rows: Payment[]; loading: boolean }) {
  return (
    <PaymentsTable
      rows={rows}
      currency="USD"
      loading={loading}
      onRowClick={(p) => console.info("open", p.id)}
      onBulkAction={(action, selected) => console.info(action, selected.length)}
      onExport={(shown) => console.info("export", shown.length)}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
rowsPayment[] Yes–
currencystring NoISO 4217 code. Default "USD".
loadingboolean No–
errorReact.ReactNode NoReplaces the rows with this message and a Retry.
onRetry() => void No–
onRowClick(row: Payment) => void No–
selectableboolean NoCheckboxes and the bulk bar. Default true.
onBulkAction(action: PaymentBulkAction, rows: Payment[]) => void No–
onExport(rows: Payment[]) => void NoExport everything in the current tab.
density"comfortable" | "compact" No–
variant"default" | "striped" | "bordered" No–
pageSizenumber NoRows per page. Default 8.
classNamestring No–

Dependencies

npm packages

lucide-react

Liro foundations, installed alongside it

liro-themeavatarbadgebuttoncard-branddata-tabletooltip

States

All of them are drawn by the component. None is left for you to design.

  • All payments
  • Failed with reason
  • Selected with bulk bar
  • Compact, striped
  • Loading
  • Empty
  • Error

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances