shadcn.io is not affiliated with official shadcn/ui
Sign-in Alerts Account Block for React
Sign-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.
Installation
Overview
Let people triage what their app flagged about sign-ins, with this sign-in alerts panel for React with Base UI. A hairline frame with a plus mark on each corner holds a list at the start and a reading pane at the end, split by a divider with plus marks. The list has two Tabs, Needs review and Resolved, each with its count in a Badge; every alert has its title, its severity as an icon and a word (Critical, Warning or Info), the day and an unread dot that opening the alert clears. The chosen alert fills the pane: what happened, a list of the device, place, address and time, and two actions only. This was me resolves the alert and the Shine Button Secure my account opens three steps to tick with a Collapsible; ticking all three resolves it as secured. Mark all read in the header clears every dot, an Empty state fills a list with nothing in it, and the pane keeps its height from alert to alert. On a phone the list and the pane take turns, with a Back button. It's built from Tabs, Badge, Collapsible, Checkbox, Empty, Button, Shine Button and Guides, with a CSS entrance only. For the security page of any app that warns people about their sign-ins.
FAQ
How do I list my own alerts?
Edit ALERTS. Each has an id, a title, a severity (critical, warning or info), a summary of what happened, the browser, city and documentation ip, an ISO when, whether it is unread, and how it stands: resolved is empty while it needs review, or "me" or "secured" with the ISO day in on. STEPS lists the three things to tick. The tab counts, the status line, the list order and the pane's facts are all worked out from those, so nothing is typed twice.
What stays local, and how do I connect it?
Everything: This was me and the ticked steps change this page's state and say so in the status line ("Marked as you in this demo. Nothing was sent."), and no account setting is touched. To make it real, call your endpoint from resolveMe (record the confirmation and clear the block) and show a failure in the same line; make each step a link to the page that does it and resolve the alert from the server when the change is seen, rather than from a ticked box.
How is severity shown without colour?
As an icon and a word: an octagon and Critical, a triangle and Warning, a circle and Info. Only the Critical icon takes the destructive colour, and no row is tinted. The unread dot is a small solid dot and the alert's name for a screen reader ends with "Unread", since a dot is not read out.
How does the reading pane keep its height?
Every alert's pane is in the page, stacked in one cell, and only the chosen one shows (the others are hidden from everyone, including assistive technology), so the pane is as tall as the tallest alert whichever you choose. Opening the three steps does grow it, because you asked for more to read. Choosing a tab picks its first alert; resolving one moves to the next in that list, and when the list is empty it says so and the pane asks you to pick.
How does it look on a phone?
The list and the pane take turns. Tapping an alert opens its pane in place of the list, with focus on its title and a Back button at the top that returns to the list with focus on the alert you left. From the medium breakpoint both show side by side and Back is hidden. The status line sits at the foot of the panel in both.
Is it accessible?
The tabs are real tabs with a panel each, the alerts are a labelled list of buttons with the open one marked as current, and the pane's facts are a description list. Both actions stay in place and focusable once an alert is resolved: pressing one says it is already resolved. The steps are checkboxes named by their sentence, and the status line is a polite live region present from the start. Addresses read start to end in any language, and the Back arrow flips in a right-to-left page.
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
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
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
Suspicious Activity Login
Risk checksA page that reports a blocked sign-in after the fact: an incident timeline of three events, the facts of the attempt, then Secure my account (which asks for the password) or This was me.
- 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
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.