Patterns
Change history (audit)
Who, what, when and why; expand to see each field old → new. The newest entry starts open.
- KA
“Fuel and staff costs went up in September; Banani already charges ৳70.”
- Car · first hour
- ৳60→৳70
- Car · each next hour
- ৳40→৳50
- Daily cap
- ৳400→৳450
- NJ
- TS
“September statement for the auditor.”
- KA
change-history.tsx
"use client";
import { ChangeHistory } from "@waveinno/ui";
export default function ChangeHistoryExample() {
return (
<ChangeHistory
entries={[
{
id: "c1",
actor: { name: "Karim Ahmed", role: "Owner" },
action: "Published",
version: "v7",
at: "Today, 11:40",
tone: "success",
note: "Fuel and staff costs went up in September; Banani already charges ৳70.",
changes: [
{ field: "Car · first hour", from: "৳60", to: "৳70" },
{ field: "Car · each next hour", from: "৳40", to: "৳50" },
{ field: "Daily cap", from: "৳400", to: "৳450" },
],
},
{
id: "c2",
actor: { name: "Nusrat Jahan", role: "Manager" },
action: "Updated",
at: "Mon, 16:12",
changes: [
{ field: "Grace period", from: "15 min", to: "10 min" },
{ field: "Lost ticket fee", to: "৳500" },
],
},
{ id: "c3", actor: { name: "Tania Sultana", role: "Accountant" }, action: "Exported", at: "Sun, 09:30", tone: "neutral", note: "September statement for the auditor." },
{
id: "c4",
actor: { name: "Karim Ahmed", role: "Owner" },
action: "Created",
version: "v1",
at: "12 Jun 2026",
tone: "accent",
changes: [
{ field: "Model", to: "Hourly blocks" },
{ field: "Car · first hour", to: "৳50" },
],
},
]}
/>
);
}Import#
Everything comes from the package root. The example above uses:
your-component.tsx
import { ChangeHistory } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<ChangeHistory>
src/components/patterns/timeline.tsx| Prop | Type | Default | Description |
|---|---|---|---|
entriesrequired | ChangeEntry[] | — | |
defaultOpen | number | 1 | How many of the newest entries start expanded. |
labels | { changes?: (n: number) => string; empty?: string } | — | |
className | string | — |
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui