shadcn.io is not affiliated with official shadcn/ui
Audit Log Notification Block for React
An admin console's audit log as a sortable table of twelve events with an action filter, rows that open to their IP address, session and before and after values, and a real CSV download of exactly the rows showing.
Installation
Overview
Keep the record and hand it over, with this audit log for React with Base UI. It is Auditmoor, an admin console, in a framed panel with a plus mark on each corner: a table of twelve events with when, who, which action (a glyph and a word) and on what, in a scroll frame with a sticky head. Pressing a head sorts by it and aria-sort says which way, a Native Select narrows the log to one action with how many events each action has, and every row opens, as a disclosure and not a link, to the resource id, the IP address, the session and the value before and after in a Data List. The block ends in a real file: "Export these rows" is a Download Trigger that saves a CSV of exactly the rows showing, in the order showing. On a phone the sort is a select and each event is a card with its action and time under the name. Lines come from Guides. For admin consoles, compliance reviews and any trail someone has to export.
FAQ
How do I fill it with my own events?
Edit ENTRIES: each has an id, a who, an action (created, updated, deleted, accessed, invited or exported), the resource and its target id, the before and after values in words, the ip and session, and an ISO at in UTC. The action menu and its counts are worked out from them, and the addresses in the file are from the ranges reserved for documentation, so none is real.
What exactly does the CSV contain?
A header row and one row per event showing, in the order showing, with the time in ISO form, who, the action, the resource, its id, the IP address, the session and the before and after values. Any cell with a comma, a quote or a line break is quoted, and a cell that starts with =, +, - or @ is kept as text so a spreadsheet cannot read it as a formula. The file is built in the browser and saved by the download trigger; it is called auditmoor-audit-log.csv and nothing is sent anywhere.
How does sorting work?
Pressing a head sorts by that column in its first direction (newest first for When, A to Z for the others) and pressing it again turns it round; ties fall back to newest first. The head's aria-sort and an arrow say which way, and a polite line says "Sorted by when, newest first". On a phone the same choice is a select above the list.
Can the log be empty?
Yes: the menu includes Exported, which has no events here, and choosing it shows a designed empty state in the same frame with a button that shows all actions. The export button then stays in place, quiet, and says there is nothing to export instead of saving an empty file.
What stays local, and how do I make it real?
Everything: the events are typed, sorting and filtering happen in the page and nothing is looked up or recorded. In your app pass your own rows, sort and filter on the server for long logs, and build the CSV from the same rows you show; keep the quoting and the formula guard, because audit text often comes from users.
Is it accessible?
It is a real table with a caption, column heads that are buttons with aria-sort, a row header and disclosure buttons that say whether the details are open and what they belong to. The frame scrolls and the keyboard can reach it, the details are removed from the tab order while closed, and each action is a glyph and a word.
Related
- Pro
Audit Log Settings
Alerts and auditA 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.
- Pro
A project's history as a vertical timeline split in two: six event types as chips with live counts in a start column, and the timeline of who did what beside them, filtered by the types you press, with Load earlier events and a designed empty state.
- Pro
Export Table
Select and actA sales table with a search and row checkboxes and an Export dialog that asks which rows (visible, selected or all, with counts), whether to include hidden columns and a file name, then downloads a real CSV, shown open in place.
- Pro
Sortable Members Table
Sort and searchA members table whose column heads are buttons: press one to sort, again to reverse, a third time for the original order, with aria-sort on the active head, ties settled by name and a spoken line for each result.
- Pro
Was This You Sign-In Alert Notification
Incidents and alertsA password manager asking whether a new sign-in was you: the device, browser, place, IP and time in hairline cells, one answer that marks it as yours, and one that opens a three-step checklist with an alert dialog before it signs the session out.
- Pro
Activity Log Account
Sessions and devicesWhat changed on an account as a vertical timeline grouped by day: icon nodes on a rail, a filter with counts for sign-in, security and data events, and a Details button that opens the device, place and address of each.