shadcn.io is not affiliated with official shadcn/ui
Access Log Account Block for React
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.
Installation
Overview
Let people see who has looked at their account, with this access log for React with Base UI. A hairline frame with a plus mark on each corner opens with a Switch, "Ask me before support opens my account", and a sentence that says what the choice costs: on, support waits for a yes and some help is slower; off, support can open the account for a ticket the person opened and every visit still shows. Under it a count worked out from the log reads "7 accesses in 90 days, every one with a ticket", a search over name, ticket and page, and a Native Select for the reason. The table has a row per visit: when, who (initials in an Avatar, name and role), the reason with its ticket number in mono, what was opened and how long it was open. The header's one Shine Button saves the rows shown as a real CSV file. From the large breakpoint down each visit is a card. It's built from Switch, Native Select, Input, Avatar, Empty, Download Trigger, Button, Shine Button and Guides, with a native table and a CSS entrance only. For the privacy page of any product where staff can open a customer's account.
FAQ
How do I load the real log?
Edit ACCESSES. Each visit has an id, an ISO at instant in UTC, the staff member's name, initials and role, the reason, the ticket it was for, what was opened and the minutes it was open. The reason filter is built from the reasons in the list, and the count line reads "every one with a ticket" only while every visit has one. Every date comes from the data and the one AS_OF constant, never the clock, and the staff names here are made up. Show only what the person may know: a real log should not name staff if your policy keeps them private, in which case show a role and a number.
What is in the CSV?
A header row, then one row for each visit shown, so searching or choosing a reason first gives a smaller file. The columns are When (UTC), Who, Role, Reason, Ticket, Opened and Minutes. Every cell with a comma, a quote or a line break is quoted, and a cell that starts with an equals sign, a plus, a minus or an at sign is kept as text by a leading apostrophe, so a spreadsheet never runs it as a formula. With nothing shown the button is marked unavailable and says there are no rows. The file is made in the browser and nothing is uploaded.
What stays local, and how do I make the switch real?
The switch: it changes this page's state and the status line says so; nothing reaches Tallowton. To make it real, save the choice in your account settings from the switch's handler, show a failure in the same status line, and enforce it on the server, since support tooling must check it before opening an account. The log itself should come from an append-only store that the person cannot edit.
Does the panel change height when I filter?
No. The table sits in a frame as tall as the full log, so searching, choosing a reason or reaching the empty state ("No access matches", with a button that clears both) leaves everything below in place. The rows have fixed heights and the cards on a phone are four fixed lines, which is what lets the frame's height be worked out from the number of visits.
How does it look on a phone?
The switch's sentence comes first, then the search and the reason filter full width, then a card per visit: when and how long at the top, the person under it, the reason with its ticket and the page that was opened. The foot with the status line stays pinned to the bottom of the screen, so the result of a filter or a save is in view. The table and the cards are one list in the markup that the large breakpoint swaps.
Is it accessible?
The table has a caption, column heads and a real time element in each row; the switch is named and its consequence is a sentence, not a tooltip. Times and ticket numbers read start to end in a right-to-left page, and names and reasons stay in their own isolated runs. The status line is a polite live region present from the start and says how many visits match and when a file was saved.
Related
- Pro
Who can see which of a person's own account events: three groups against five categories as a matrix of switches, with the locked ones explained, a sentence that adds the matrix up and a Save that counts changes.
- 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.
- 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
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
Two-Factor Methods Account
Sign-in methodsAn account's two-factor methods as rows with their role, history and a Test that opens a code field in place, Make primary, a guarded Remove, and a Set up that opens a QR code, a key name or a number.
- Pro
Account Delegation Account
Shared accessThe people who can act on an account as a matrix: a row for each delegate with a box for each of four scopes, pending invitations with Resend, an invitation form whose role ticks the scopes, and Undo.