Audit Log Table
Who did what, when and from where, with a pinned header, level filter and export.
PROGet Audit Log Table and 168 other Pro components with pro lifetime — Get Pro
- Category
- Data Tables
- Access
- ProPro · unlocked
- Source
- 225 lines · one file
- States
- 6 drawn
- Kind
- Block
The decision inside it
People and bots look different
The first question about an event is who did it, the second is whether it was a human. A face or a robot mark answers both before you read the name.
When to use it
Use Audit Log Table for a workspace's security log: UTC time, person or bot, action in mono, target, IP and level, with a pinned header, level tabs and Export. For the history of one document use Audit Trail.
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 Log Table for this.
Install it: npx shadcn@latest add @liro/audit-log-table
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/audit-log-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 { AuditLogTable, auditCsv, type AuditEvent } from "@/components/ui/audit-log-table";
export function AuditLog({ rows }: { rows: AuditEvent[] }) {
return (
<AuditLogTable
rows={rows}
maxHeight={480}
onExport={(shown) => {
const url = URL.createObjectURL(new Blob([auditCsv(shown)], { type: "text/csv" }));
window.open(url);
}}
/>
);
}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 | AuditEvent[] | Yes | – |
loading | boolean | No | – |
error | React.ReactNode | No | – |
onRetry | () => void | No | – |
onRowClick | (row: AuditEvent) => void | No | – |
onExport | (rows: AuditEvent[]) => void | No | Download what is shown. Leave out to hide Export. |
maxHeight | number | No | Height of the scrolling log in px; the header stays pinned. Default 440. |
density | "comfortable" | "compact" | No | – |
variant | "default" | "striped" | "bordered" | No | – |
className | string | No | – |
Dependencies
npm packages
clsxlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themeavatarbadgebuttondata-tableStates
All of them are drawn by the component. None is left for you to design.
- All events
- Errors only
- Searching
- 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