Audit Trail

Evidence per event, and it flags its own hash breaks.

PROGet Audit Trail and 168 other Pro components with pro lifetime — Get Pro

Category
Documents
Access
Pro
Source
659 lines · one file

The decision inside it

The trail reports its own breaks

If the document hash changes between two events, the document changed in between. A record that cannot contradict itself is decoration, not evidence.

When to use it

Use Audit Trail for the signing history of a document: who sent, viewed, signed or declined it and when, with location, device and the document hash, and an export.

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 Audit Trail for this.
Install it: npx shadcn@latest add @liro/audit-trail
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/audit-trail.
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/doc-history.tsx
import { AuditTrail, type AuditEvent } from "@/components/ui/audit-trail";

const events: AuditEvent[] = [
  { id: "1", kind: "sent", actor: { email: "michael@madgixs.com", name: "Michael Carter" }, at: "2026-10-01T09:12:00Z" },
  { id: "2", kind: "signed", actor: { email: "ada@vertically.dev", name: "Ada Moss" }, at: "2026-10-02T14:40:00Z", location: "Berlin, DE" },
];

export function DocHistory({ exportPdf }: { exportPdf: () => void }) {
  return <AuditTrail title="Audit trail" documentName="Vertically MSA" events={events} onExport={exportPdf} />;
}

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
lookLook No"layered" (default): the record rests as a card in a tray, the document's standing in the strip under it. "flat": one card, the strip as its floor.
titlestring No–
documentNamestring NoThe document these events belong to.
eventsAuditEvent[] No–
loadingboolean NoWaiting on the server. Shows skeleton rows rather than an empty state.
defaultExpandedboolean NoStart with every row's evidence open.
filterThresholdnumber NoShow the filter control. Off below a handful of events.
onExport() => void | Promise<void> NoCalled when the certificate is requested. Given, a Download button appears; the promise keeps the button in its working state until it settles.
onClose() => void NoGiven, the header grows a close button.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-themeavatartooltip

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