PaymentStatusTimeline
- Status
- Implemented
- Family
- 3 of 13
- Registry
- @lopifi/payment-status-timeline
npx shadcn@latest add @lopifi/theme @lopifi/payment-status-timelineThe component, rendering
Real data, the shipped component. Switch the theme to check the claims the spec makes below.
The four-layer spec
Submitted → Sent → In transit → Settled, each with a real timestamp and timezone. Failed states show the reason and the remedy. Pending is a state, not a load — a clock icon, never a spinner.
Lifted verbatim from Payments. The doc and this page are the same paragraphs, so they cannot disagree.
What lands in your repository
One component is never one file. Everything below is copied into your project, where you own it.
- Files
components/ledger/payment-status-timeline.tsx
- Lopifi dependencies · 3
- cnfiscal-periodicons
- npm packages
- clsxtailwind-merge
- Registry entry
- /r/payment-status-timeline.json
The whole component
No compiled bundle, no black box. This is the file the registry copies, and the file you will edit.
import * as React from "react";
import { cn } from "@/lib/ledger/cn";
import { formatTimestamp } from "@/lib/ledger/fiscal-period";
import { CheckIcon, ClockIcon, ExclamationTriangleIcon } from "@/components/ledger/icons";
export type TimelineStep = {
label: string;
at: Date | null;
state: "done" | "pending" | "failed";
/** On failure: what happened and what to do about it. */
reason?: string;
remedy?: string;
};
export interface PaymentStatusTimelineProps extends React.ComponentPropsWithoutRef<"ol"> {
steps: TimelineStep[];
timeZone?: string;
}
/**
* Submitted → Sent → In transit → Settled, each with a real timestamp and a
* stated timezone. Pending is a state, not a load — a clock icon, never a
* spinner.
*/
export const PaymentStatusTimeline = React.forwardRef<HTMLOListElement, PaymentStatusTimelineProps>(
({ className, steps, timeZone = "UTC", ...props }, ref) => (
<ol className={cn("flex flex-col", className)} ref={ref} {...props}>
{steps.map((step, i) => {
const last = i === steps.length - 1;
return (
<li className="flex gap-3" key={step.label}>
<div className="flex flex-col items-center">
<span
aria-hidden="true"
className={cn(
"grid size-6 shrink-0 place-items-center rounded-full border",
step.state === "done" && "border-positive bg-positive-subtle text-positive",
step.state === "pending" && "border-border-strong text-text-tertiary",
step.state === "failed" && "border-negative bg-negative-subtle text-negative",
)}
>
{step.state === "done" ? (
<CheckIcon className="size-3" />
) : step.state === "failed" ? (
<ExclamationTriangleIcon className="size-3" />
) : (
<ClockIcon className="size-3" />
)}
</span>
{!last ? (
<span
aria-hidden="true"
className={cn("w-px flex-1", step.state === "done" ? "bg-positive" : "bg-border")}
/>
) : null}
</div>
<div className={cn("pb-6", last && "pb-0")}>
<p
className={cn(
"text-body font-medium",
step.state === "pending" && "text-text-secondary",
step.state === "failed" && "text-negative",
)}
>
{step.label}
</p>
{step.at ? (
<p className="numeric text-caption text-text-tertiary">
{formatTimestamp(step.at, timeZone)}
</p>
) : (
<p className="text-caption text-text-tertiary">Not yet</p>
)}
{step.reason ? <p className="mt-1 text-caption text-text-secondary">{step.reason}</p> : null}
{step.remedy ? (
<p className="mt-1 text-caption font-medium text-text-primary">{step.remedy}</p>
) : null}
</div>
</li>
);
})}
</ol>
),
);
PaymentStatusTimeline.displayName = "PaymentStatusTimeline";
The accounting it encodes
Concepts this component renders. Each one is defined once, in the lexicon, and used identically in the code and the copy.
Also in Payments
- AmountInputThe hardest input in fintech.
- CurrencySelectSearchable, with recents.
- PayeeSelectRecipient picker with fuzzy search and last-paid.
- PaymentFormAmount → payee → method → date → memo.
- PaymentMethodListSelectable method cards.
- CheckoutSummaryItemized total with fees and tax.
- ConfirmPaymentDialogAmount, destination, timing. Hold-to-confirm.
- PaymentSuccessThe sanctioned delight moment.
- ReceiptSheetPrintable/shareable receipt.
- PayoutScheduleUpcoming payouts calendar.
- CardInputPAN / expiry / CVC with correct autocomplete.
- BankAccountInputRouting + account with checksum validation.
- RecurringScheduleFrequency, end condition, preview of next 3.
See also
A component is specified in one place, defined in another, and running in a third. All three, from here.
- Payments — the family specThe four-layer specification this component was built against, before it was written.Doc
- Payment forms, methods and receiptsThe family running, with real figures in it, in both themes and at every density.Live
- CatalogAll 179 components, specified before they are written.Doc
- SettledFinally and irrevocably transferredTerm
Elsewhere in the system
Where PaymentStatusTimeline sits in the rest of the system — the live section it renders in, the calculators that compute what it displays, and the ledger payloads it is fed from.
- PaymentStatusTimeline, runningThe payments showcase — live, with theme, density, greyscale and reduced-motion switches.Live
- Payments and allocationHow is a payment tied to the documents it settles?API
- PaymentsPayments — specs for 14 React components: AmountInput, CurrencySelect, PayeeSelect, PaymentForm and 10 more.Doc
Components are copied into your repository and meant to be edited — rounding policy, fiscal calendar and compliance copy differ per company.
Told when Payments changes
Components are copied into your repo, so a fix here does not reach you on its own. One email when a component in this family changes in a way that needs a migration — and nothing when it does not.