shadcn.io is not affiliated with official shadcn/ui
Sign-in History Account Block for React
Every 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.
Installation
Overview
Let people check who tried to get into their account, with this sign-in history panel for React with Base UI. A hairline frame with a plus mark on each corner opens with a strip of four figures worked out from the attempts: how many there were, how many failed, how many came from places the account had not been used from, and when the last one succeeded. Below it a toolbar holds a search over place and address in an Input and a Native Select for the result. The table has a sortable When, Result, Method and Place, the address in mono and the browser. A failed attempt has an X icon, the word Failed and its reason in a few words, and no tint. A row opens, with a Collapsible on a phone, to the full user agent, the steps the attempt went through and the reason in full. The foot says which rows show, sets pages of 5 or 10 and holds the catalog Pagination. Searching, sorting and paging keep the panel's height, and a search that matches nothing shows an Empty state with a way back. Below the large breakpoint each attempt is a three-line card. It's built from Input, Native Select, Collapsible, Pagination, Empty, Button and Guides, with a CSS entrance only. For the security page of any app with a record of sign-ins.
FAQ
How do I list my own attempts?
Edit SOURCES (a place and a program: city, documentation address, browser, the user agent and how it signs in) and ATTEMPTS (a time in UTC, the source, and for a failure its short reason, the full one and the step it stopped at). The four figures, the method chain in each row, the sort orders and the page counts are worked out from those, so nothing is typed twice. KNOWN lists the places the account was already used from; any other place counts as new.
What can the table do?
Sort by When, Result, Method or Place: the first press picks the column's usual direction (newest first, failed first, A to Z), the next reverses it, and the header says which with an arrow and for a screen reader with the column's sort state. Search matches part of a place or an address, the result menu limits the list to the ones that went through or failed, and each change goes back to the first page. A search or a result with no match shows an empty state with a button that clears both. The panel keeps the height of a full page, so none of this moves it; choosing 10 per page does, on purpose.
How is a failed attempt shown without colour?
Every result is an icon and a word: a check and Succeeded, or a cross and Failed with its reason ("Wrong password") under it. Only the cross takes the destructive colour, and the row isn't tinted. Opening the row gives the reason in full, the steps it went through ("Password, Rejected") and the full user agent, for the attempts worth a second look.
What stays local, and how do I connect it?
It is all typed, read-only data, so there is nothing to undo or save. To make it real, build ATTEMPTS from your sign-in log (time, source address, user agent, the method and the outcome) and resolve the place from the address on your server. Page on the server for a long history: the table already shows only one page, and the page links are real links with a page query. Times are shown in UTC; convert them to the person's zone if you prefer.
How does it look on a phone?
Below the large breakpoint the table is replaced by a list of cards of the same three lines: when and the result, the method with the browser (or the reason, for a failure), and the place with the address. A card is a button that opens the same details under it. The four figures stay two by two above, and the page links wrap under the row count.
Is the table accessible?
It is a native table with a caption, column headers with their sort state and a button in each sortable header. The first cell of every row is a button that says which sign-in it opens ("Details of the sign-in on 14 Oct, 07:48") and whether it is expanded. The row count is a polite status that is present from the start, the page links are a labelled navigation with the current page marked, and the addresses read start to end in any language.
Related
- 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.
- 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
Session History Account
Sessions and devicesThe last seven days of sessions as a swimlane: a lane per device, each session a bar placed by its start and length, revoked ones ending in a cut mark, and a popover with the id, length, address and how it ended.
- 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
Pre-Login Security Audit
Risk checksA pre-sign-in checklist panel: six typed checks in an accordion with a glyph and a word each, a fix and an I have done this box on the ones that fail, Re-check and a Continue that waits for no failures.
- 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.