shadcn.io is not affiliated with official shadcn/ui
Audit Log Settings Block for React
A settings change history in a fixed-height window: changes grouped by area in folds with counts, an actor filter, and a detail pane with the before and after values, who and when, and a Revert that undoes only the latest change to a setting, marks the original and adds a revert event at the top.
Installation
Overview
Give admins a history they can act on, not just read, with this audit log window for React with Base UI. A framed window of fixed height has a top bar with its title and the one action, a list on the start side and a detail pane beside it. The list groups a workspace's settings changes by area (security, members, billing, integrations): each group is a fold with its count, and a Native Select above them filters by who made the change. Choosing a change opens its detail: the setting's name, the value before and the value after in a Data List, who made it and when, and a sentence about what a revert would do or why it can't be done. The top bar's Shine Button reverts the chosen change to its previous value: the original is marked Reverted, a "Revert" event by you appears at the top of its group, and the status line says that in this demo nothing was changed. Only the latest unreverted change to a setting can be reverted, because undoing an older one would silently undo the newer one too; the button explains which comes first. The window holds its height and only the panes scroll, and the frame carries the plus marks. On a phone the list and the detail are one pane at a time with a Back button. It's built from Native Select, Data List, Badge, Button, Shine Button and Guides, with a CSS entrance only. For an admin console, a workspace or any product where settings change hands.
FAQ
How do I fill it with my own history?
Edit START, newest first or in any order: each change has an id, an area, a setting id (two changes to one setting share it), a name, the before and after values as text, who made it (actor) and an at moment in UTC. AREAS names the groups and ACTORS fills the filter. In your app the history comes from your audit service; keep the values as the strings people read, not raw JSON.
What does Revert do, and why can't I revert an older change?
It sets the setting back to the value before the chosen change, marks that change Reverted and adds a new event to the top of its area: a revert by you, whose before and after are the other way round. Only the latest change to a setting that nothing has undone can be reverted, since reverting an older one would also throw away the newer one. Pressing Revert on any other change leaves everything as it is and says which one comes first. A revert event can't itself be reverted, and a change that has been reverted can't be again.
What stays local, and how do I make it real?
Everything. A revert only changes the list in the page, and the status line says nothing in your workspace was changed. To make it real, send the change's id to your server in the revert handler, let it apply the previous value and write the revert event, and replace the list from its response. Keep the rule that only the latest change can be reverted on the server too.
How do the folds and the filter work?
Each group heading is a button that opens or folds its list, with the open state announced and the group's count beside it. The filter shows only the changes by the person you choose, and each count follows it, so a group with nothing says "No changes here by" that person; the status line says how many changes are shown. The chosen change stays in the detail pane even when the filter hides it from the list.
How does it work with a keyboard and a screen reader?
Tab runs through the revert button, the filter, each group button, each change and the detail. The chosen change is marked aria-current, and the group buttons carry aria-expanded and aria-controls. Choosing a change on a phone moves focus to the detail's heading, and Back moves it to the change you came from. The revert button stays focusable when it can't act and explains why in the status line.
Related
- Pro
Audit Log Retention Settings
Backups and exportsAn audit log retention panel with a row for each class of event, a preset for how long to keep it, an archive-after menu, a legal hold that freezes the row and a two-part bar to one scale, with the gigabytes searchable and archived added up from typed daily volumes.
- Pro
Backup and Restore Settings
Backups and exportsA backups page with a list of six snapshots and the three-step restore that opens from it, shown open on load: choose what to bring back, read the impact and type the snapshot date to confirm, then watch a progress bar fill and end on a plain statement that nothing was restored in the demo.
- Pro
Notification Channels Settings
Alerts and auditA destinations window for alerts: a rail of Slack, email, PagerDuty, webhook and SMS destinations with a status word, beside the chosen one's routing by severity, a pause switch and a simulated test.
- Pro
Alert Rules Settings
Alerts and auditAn alert rules panel where each rule is a sentence you edit in place with menus and a number field, beside a framed chart of its metric with the threshold line and a computed count of how often it would have fired.
- Pro
Error Reporting Settings
Alerts and auditAn error grouping panel that leads with a tester: paste an error message and it says whether the rules would drop it, group it under a named group or start a new one, beside tabs of grouping rules, ignore patterns and sample rates.
- Pro
Incident Escalation Settings
Alerts and auditAn escalation policy on a vertical rail whose axis is the clock: tiers with a target, a channel group and a timeout, cumulative minutes on every node, add, move and remove, and a re-page switch.