Prodular UI

Audit log

Pro

Who did what, to which record, and when. Events group by day and expand to their before and after values and request context; filter by actor, record type and time, and search across everything.

npx prodular-ui add audit-log

Part of Prodular UI Pro. Preview and read the docs freely, install with a license. See pricing

Workspace audit log

People, an API key, an agent and the system. Open an event for its changes; long text shows as a word diff. Times are in UTC.

Today · UTC

Yesterday · UTC

Anatomy

<AuditLog  events={events}  onLoadMore={loadOlder}  hasMore={cursor !== null}  timeZone="UTC"  actions={<Button variant="outline" size="sm">Export</Button>}/>

Guidance

Use it when

  • Security, compliance and admin pages: role changes, key creation, exports, sign ins and settings.
  • A record's own history, filtered to that resource.
  • Agent actions, with the approval that allowed them in metadata.

Avoid

  • Activity feeds for collaboration. Use Timeline with comments and attachments.
  • Application logs and errors. They need levels and streaming, not actors and records.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Map each server event to { id, action, actor, resource, at, changes?, ip?, location?, userAgent?, metadata?, severity? }. Keep action dotted, like invoice.updated.
  • The sentence is built from actor, the last part of action and the resource; pass summary only when that reads wrong.
  • Record changes as { field, before, after } with display values, not raw ids.
  • For large logs, page on the server: pass onLoadMore and hasMore and append events. Otherwise pageSize reveals more rows locally.
  • Pass timeZone="UTC" for compliance views and a fixed now in tests so relative ranges stay stable.
  • Mark security relevant events with severity warning or critical. Never put secrets in metadata.

API

AuditLog

PropTypeDefaultDescription
eventsAuditEvent[]Events in any order; they sort newest first.
pageSizenumber25Rows before Show more, when everything is loaded.
onLoadMore / hasMore() => Promise<void> / booleanServer paging. Load older events calls onLoadMore.
loadingbooleanfalseSkeleton rows.
now / timeZoneDate / stringThe clock for ranges and the zone for times and days.
actionsReactNodeRight side of the toolbar, like Export.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add audit-log# or, with the registry in components.jsonnpx shadcn@latest add @prodular/audit-log