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
- ProPro · unlocked
- 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
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.
| Type | Notes | ||
|---|---|---|---|
rows | Payment[] | Yes | – |
currency | string | No | ISO 4217 code. Default "USD". |
loading | boolean | No | – |
error | React.ReactNode | No | Replaces the rows with this message and a Retry. |
onRetry | () => void | No | – |
onRowClick | (row: Payment) => void | No | – |
selectable | boolean | No | Checkboxes and the bulk bar. Default true. |
onBulkAction | (action: PaymentBulkAction, rows: Payment[]) => void | No | – |
onExport | (rows: Payment[]) => void | No | Export everything in the current tab. |
density | "comfortable" | "compact" | No | – |
variant | "default" | "striped" | "bordered" | No | – |
pageSize | number | No | Rows per page. Default 8. |
className | string | No | – |
Dependencies
npm packages
lucide-reactLiro foundations, installed alongside it
liro-themeavatarbadgebuttoncard-branddata-tabletooltipStates
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