shadcn.io is not affiliated with official shadcn/ui
Transfer Ownership Settings Block for React
A three-step alert dialog for handing over a workspace, open over the members list: choose an admin, review the before and after of both roles, type the workspace name, then a pending state with Cancel transfer.
Installation
Overview
Make the biggest decision in a workspace one people can't make by accident with this ownership transfer for React with Base UI. The page is a members list under a header with the real trigger, Transfer ownership, and the block opens with its alert dialog drawn over the list. Step one chooses the next owner from the admins only, with a search over their names and the reason the other members are missing. Step two shows a table of the before and after of both roles (you: Owner to Admin; them: Admin to Owner) and what moves to them. Step three asks for the workspace name, typed exactly, and its action is the destructive Button, with focus on Cancel when the dialog opens. Steps number the three stages and the dialog never changes height between them. Confirming doesn't change anyone: the members list shows Transfer pending until the person accepts, with Cancel transfer, and the header's button waits. It's built from Alert Dialog, Steps, Data List, Avatar, Input, Button and Guides, with a CSS entrance only. For property, team or billing tools where one person owns the account.
FAQ
Is the dialog really open on the page?
Shown open in place for the preview: on load a copy of the alert is drawn over the members list as a native non-modal dialog element, so nothing is trapped or focused and the page around it stays readable. Press Transfer ownership in the header and the real Alert Dialog opens, with its focus trap, Escape, focus on Cancel and no close on an outside click; the in-place copy stays closed until a reload. Both share one content component and the same state, so what you chose in place is there in the real one. In your app keep only the Alert Dialog.
What does each step ask, and what stops it?
Step one needs an admin chosen: Continue waits quietly and, pressed early, says Choose an admin first and moves focus to the list. Step two has nothing to fill in and shows the table and what moves, with Back to return. Step three needs the workspace name exactly, capitals included, and the line under the field says Matches or Does not match as you type. Cancel, Escape and the in-place Cancel all leave everything as it was.
What happens after the last step?
Nobody's role changes. The dialog closes, the head of the members list says Transfer pending until that person accepts, the header's button reads Transfer pending and waits, and Cancel transfer puts everything back with focus on Transfer ownership. A real product keeps the current owner in charge until the other person accepts, and expires the offer; this demo has no clock, so the offer stays until you cancel it.
How do I fill it with my own members?
Edit PEOPLE (an id, a name, an address and a role of owner, admin, editor or viewer), WORKSPACE (the name to type) and MOVES (what the new owner gains). The admins listed in step one, the counts and the before and after table all come from PEOPLE.
What stays local, and how do I make it real?
Everything. Nothing is transferred or emailed, and the status line says so. To make it real, send the chosen person's id from submit on the last step, let your server email them and hold the offer, and keep the rules there: only the owner can start a transfer, only an admin can be offered it and the offer needs the other person's acceptance.
How does it work with a keyboard and a screen reader?
The dialog is an alert dialog: focus starts on Cancel and stays inside until it closes, Escape closes it and focus returns to the trigger. Each step moves focus to its first control (the search, the review sentence, the name field), and a polite line inside the dialog says Step 2 of 3: Review. The admins are native radios in a labelled group, so arrow keys and a click on the whole row work. While the real dialog is open the page's own status line is muted so it isn't spoken twice.
Related
- Pro
Danger Zone Settings
Backups and exportsThree destructive actions that ask for more the harder they are to undo: Pause in one click, Archive behind an alert dialog, Delete behind a typed workspace name and a slide-to-confirm button, with a 14-day Restore.
- Pro
Account Deletion Settings
Backups and exportsA whole-page account deletion that first asks what happens to each kind of data (delete, anonymise or transfer, with invoices locked for tax law), sums the choices in one sentence, then schedules deletion 14 days out behind a typed-email alert dialog.
- Pro
Role Permissions Settings
Team and rolesA roles window with a rail of five roles and a detail of grouped permissions: mixed-state group boxes, a Compare with select that marks each permission with a plus or a minus, read-only system roles and Duplicate to edit.
- Pro
Team Members Settings
Team and rolesA members panel with seat and two-factor meters, a native table with row selection, a role menu per person and, pinned at the foot, a bulk role change and Remove that an Undo walks back one step at a time.
- Pro
Delete Account Dialog
Destructive confirmsA notes app's settings page with its account deletion shown open: an alert dialog in three numbered steps, what goes with a real data download, the email typed exactly, then the password and a 14-day grace switch.
- Pro
Confirm Delete Dialog
Destructive confirmsA planner's project list with its delete confirmation shown open: an alert dialog that lists what goes with the project, asks for its name to be typed exactly, and keeps Delete off until it matches.