shadcn.io is not affiliated with official shadcn/ui
Activity Log Account Block for React
What 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.
Installation
Overview
Show people what has changed on their account, with this activity log for React with Base UI. A hairline frame with a plus mark on each corner opens with a filter band: a Toggle Group of All, Sign-in, Security and Data, each with its count, and a live line saying how many events show. Below it is a vertical timeline grouped by day, newest first: each day has a label and how long before the as-of day it was, and each event is a node on a rail, an icon in a neutral circle with no card around it. An event has its title, what it was about, the time in UTC, an outline Badge with its category word and a Details button that opens, with a Collapsible, the device, place and address it came from. Filtering takes events and empty days out of the timeline while the panel keeps its height, and on a phone the filter scrolls sideways and the rail stays. It's built from Toggle Group, Collapsible, Badge and Guides, with a CSS entrance only. For the security page of any app that wants people to see changes to their own account, not a table of attempts.
FAQ
How do I list my own events?
Edit ENTRIES, newest first. Each has an id, a title, a note of what it was about, a category (signin, security or data), a glyph that picks the icon, an ISO when in UTC and the browser, city and documentation ip it came from. The day groups, their weekday names, the "Yesterday" and "6 days before" wording (worked out from the typed AS_OF day, never the clock) and every count are derived, so nothing is typed twice. Add a glyph to GlyphIcon for a new kind of event.
What does the filter do?
Choosing a category shows only its events and drops the days that have none left, and the count line says "3 of 8 events". The timeline sits over an unseen copy of the whole log, so the panel never changes height. A change that is both a sign-in and a security event belongs to one category: put it where a person would look for it. Choosing a filter closes any open details.
What stays local, and how do I connect it?
It is read-only typed data, so there is nothing to save or undo. To make it real, build ENTRIES from your audit log on the server (the person's own changes, not staff access), group by the person's own day if you prefer to show their zone, and load older days in pages or with a Show more button of your own. A log that can be empty needs an empty state: add the catalog Empty in place of the timeline.
How do the details work?
Details is a real button, named for its event ("Details of Password changed, 07:13"), that opens the device, place and address in a list. Opening one closes the last. Escape isn't bound: the button toggles, so pressing it again closes. Closed details are not in the tab order or read out.
How does it look on a phone?
The rail stays at the start and the events keep their nodes; the title and note wrap beside the time and category. The filter is one row that scrolls sideways when it doesn't fit, with its focus ring kept inside. Details open under the event as on a wide screen.
Is it accessible?
The timeline is an ordered list of days, each with a heading, and each day an ordered list of events, so a screen reader announces the position of an event in its day. The nodes are decorative: every event has its title, its category as a word and its time as text. The filter is a labelled group of toggles with their counts in their names, and the line that says how many events show is a polite status present from the start. Times and addresses read start to end in any language.
Related
- Pro
Sign-in History Account
Sessions and devicesEvery sign-in attempt in the last 14 days in a sortable, searchable table with failed attempts marked by an icon and a reason, rows that open to the user agent and steps, pages of 5 or 10 and four derived figures.
- Pro
A person's own log of staff visits to their account: a switch that makes support ask first, a search and a reason filter, a table of visits with who, why, the ticket and what was opened, and a real CSV of the rows shown.
- Pro
Active Sessions Account
Sessions and devicesThe open sessions of an account with how each one signed in, when it started, was last active and ends, an idle filter, a two-step sign-out per row and one button that signs out the rest.
- Pro
Devices Account
Sessions and devicesThe devices that have signed in to an account as hairline tiles grouped by type, each with its browsers, sessions, place, address and a menu to rename or remove it, and one button to remove every other device.
- Pro
IP Allowlist Account
Sessions and devicesAn allowlist built from the networks of the last 12 sign-ins and rehearsed against them: seen networks with Allow, the allowed set, one field to add a range, how many sign-ins would pass or be blocked, and a switch refused while your own address is outside the list.
- Pro
Sign-in Alerts Account
Sessions and devicesSign-in alerts as a list and a reading pane in one panel: tabs for Needs review and Resolved, severity as an icon and a word, unread dots, and a pane with two actions, This was me and Secure my account with three steps to tick.