shadcn.io is not affiliated with official shadcn/ui
Emergency Access Login Block for React
A break-glass sign-in: a logged-and-reviewed notice, an emergency code, a typed reason and a second approver, a live audit entry that fills in as you type, and a simulated approval.
Installation
Overview
Let people in when the usual sign-in cannot be used, and leave a trail, with this emergency access login block for React with Base UI. It's the break-glass page of Wardlark, a hospital records system: a whole screen with the page's rails and one band across it, a centred column. A catalog Alert says every use is logged and reviewed. The form asks for an emergency code, a reason in your own words in a Textarea, a second approver from a short list and a Checkbox that you understand it is logged, and under them an audit entry fills in as you type, with a line for where the approval stands. The one Shine Button asks the second approver: a simulated approval runs two short beats from the press, and then the form gives way to the open state, who approved, when the access ends and the finished entry, with a button to end it. It's built from Alert, Field, Input, Textarea, a native select, Checkbox, Shine Button and Guides, with a CSS entrance only. For hospital, finance and admin systems with a break-glass route.
FAQ
What stays in the page, and how do I wire it for real?
Everything. The code, the people, the date and the time are typed, the approval is two timers that start when you press the button, and nothing grants access, notifies anyone or writes a log. In a product, the server checks the code, sends the approval request to the second person, writes the audit entry before it grants anything and gives the access an expiry it enforces itself; the page only shows what the server did.
Where does the audit entry come from?
It is built from the form as you type: who, the date and time, your reason in quotation marks, the approver and when the access ends. Anything still missing reads "(not given yet)" or "(not chosen yet)", so the entry is never silently incomplete. The reason is limited to 60 characters so the entry has a bounded length, and the box keeps its height as the words change.
How does the second approver work?
It is simulated and starts on the press: the page asks the approver you chose, the approval line reads "Asking Lucia Marangoni…", then "Approved by …", and after about a second the open state shows. Choosing a different person changes who is named, nothing else. Pressing with a field missing names the first problem under its field and focuses it instead.
Is there a confirmation dialog?
No. Nothing is revoked or destroyed by pressing the button: it asks for access that expires on its own, and ending it early is a plain outline button in the open state. A destructive confirmation belongs to an action that cannot be undone.
Related
- Pro
A sign-in that works only in set hours: a week grid of 24 hour cells for each day with a derived next window, a readout for any cell, and a request for off-hours access.
- Pro
A network check for a sign-in: type an IPv4 address and real CIDR maths says which of three allowed ranges holds it, then either continues or asks for access with a reason.
- Pro
Lockout Recovery Login
Recovery and resetA recovery chooser for a utility account where ticking what you still have (email, phone, a backup code or none) ranks the ways back in live, with a daily request count.
- Pro
Account Locked Login
Recovery and resetA locked-account page for a point-of-sale system that draws the lockout ladder, marks the rung the account is on with a fixed unlock time, and offers an unlock link by email or a password reset.
- Pro
Legacy Contact Account
Shared accessOne person an account may tell if its owner stops signing in: a replaceable contact, a slider of the inactivity period by stops with the consequence written with real dates, what they may ask for and what they can never do.
- Pro
Alert Banner Login
Centered formA full-height sign-in page for a database host with a maintenance notice pinned above the form: a quiet alert with the window in UTC, a Details popover and a Dismiss that never moves the form.