shadcn.io is not affiliated with official shadcn/ui
Legacy Contact Account Block for React
One 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.
Installation
Overview
Let people choose who is told if they disappear, and see exactly when, with this legacy contact panel for React with Base UI. A hairline frame with a plus mark on each corner holds two cells, split by a divider. One holds the contact: initials, name, relationship, a masked email, a Verified badge and a Replace button that opens a real Dialog; under it a Slider of the inactivity period by stops (3, 6, 12 or 18 months) and the consequence written from it with real dates, when you would be emailed and four weeks later when the contact would be told. The other holds three Checkboxes for what they may ask for (documents, contacts, messages), the list of what they can never do and a ghost button that sends them a test notice. Dates count from the typed last sign-in, never the clock. The Shine Button saves the draft in the page and Discard puts the saved one back. It's built from Slider, Checkbox, Dialog, Avatar, Badge, Field, Button, Shine Button and Guides, with a CSS entrance only. For the account page of any app that holds things people leave behind.
FAQ
How do I fill it with my own contact and stops?
Edit START_CONTACT, STOPS (a label, the number of months and a short word for the ruler), ASKS and NEVER. consequenceOf turns the stop and the typed last sign-in AS_OF into the sentence, with GRACE_DAYS between the email to the owner and the notice to the contact. Change AS_OF to the owner's real last sign-in when you wire it up; the dates are worked out from it, never the clock.
How does the slider work?
Its value is a place on the track, not a number of months: each stop has a name, which is what assistive technology reads ("12 months"). Arrow keys move one stop and the sentence under it is rewritten with the new dates, in a box tall enough for the longest one, so nothing below moves.
How does Replace work?
It opens a dialog with the contact's name, email and relationship. Each field is checked in words and focus goes to the first problem. A new contact starts as "Not confirmed yet", the sentence says no one is told until they confirm, and the replacement is part of the draft: Discard puts the old contact back. Escape or Cancel closes the dialog and focus returns to Replace.
What stays local, and how do I make it real?
Everything. Saving keeps the draft in this page only, and the test notice is queued only in words: nothing is emailed. To make it real, call your endpoints in save, replace and testNotice, send the contact an email that asks them to confirm, and tell them only when they have. Keep the list of what they can never do true on your server.
Why is there a list of what the contact cannot do?
Because a legacy contact is a promise to the account's owner. The list is typed in NEVER and is meant to be edited to match what your product really enforces; the boxes above it are the only things the contact may ask for, and asking is all they can do.
Is it accessible, and how does it look on a phone?
The boxes are named for what they allow with their hints linked, the slider is named and reads its stop, the email is masked in text, and the foot is a polite live region present from the start. The cells stack on a phone, the contact and the slider first, and the foot with Save stays pinned to the bottom of the screen.
Related
- Pro
Recovery Options Account
Sign-in methodsAn account's recovery options: four numbered ways back in, each with its state in words, a masked value, a quiet test and a one-field form to set it up, and a line that counts how many are ready.
- 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.
- Pro
Delegate Access Account
Shared accessTemporary access to an account: a list of active grants with how far through each is and when it ends, End now with Undo, and a side sheet that picks a person, what they can do and 1 to 90 days.
- Pro
Trusted Devices Account
Sessions and devicesAn account's trusted devices as a table of devices against two switches, one to skip the sign-in code and one to skip the password prompt, with a sentence on what each device's choice means and a meter against the limit.
- Pro
Permissions Account
Shared accessA read-only matrix of what each role may do: permissions in four folding groups against four roles with counts, your own role framed and marked You, and a Request button on what it lacks.
- Pro
Team Members Account
Shared accessThe people who can sign in to a shared account as hairline tiles: role menu, two-factor on or off, last sign-in, those without two-factor first with a reminder button, pending invitations and an invite form.