shadcn.io is not affiliated with official shadcn/ui
Transfer Ownership File Upload Block for Svelte
A handover dialog for a team drive: choose who is leaving, give each of their folders a new owner or all of them at once, see the files per new owner, and confirm in an alert dialog; shown open over a drawn drive.
Installation
Overview
Hand a leaver's files to the people who stay without losing track of any, with this transfer ownership dialog for Svelte with Ark UI. It is the handover of Batonpass, a team drive. A Dialog picks who is leaving in a Native Select, lists their folders with the file count and size of each, and gives every folder a new-owner select; Give all to fills the whole list at once. The totals per new owner are worked out as you choose ("Priya Natarajan 14 files"), and a problem, such as folders still without an owner, shares one reserved line with them. Transfer, the Shine Button, asks for confirmation in an Alert Dialog that says what will move and who loses access; Cancel there returns to the form with your choices, and confirming changes the owners in the drawn drive behind. Shown open in place for the preview; in your app keep the Dialog and the Alert Dialog. Guides frame the stage. For team drives, offboarding and any product where files have an owner.
FAQ
Which part is the preview's?
On load the dialog is drawn open in place over a drawing of the drive, so nothing is trapped or focused. The Transfer files button in the header opens the real Dialog, with a focus trap, Escape and focus back to the button, and the in-place copy stays closed until you reload. In your app keep the Dialog and the Alert Dialog and drop the in-place copy.
What does the confirmation say, and what does Cancel do?
The alert names how many files move from whom, lists the files per new owner and says the leaver loses access. Cancel is focused first and goes back to the form with every choice kept; Escape in the alert does the same. Only the Transfer files button in the alert changes anything.
How are the totals worked out?
From the folders and your picks: the files of every folder given to a person are added up, so changing one folder's owner changes two totals at once. Folders without an owner are counted in the same line, and Transfer will not go on until none are left.
What if the leaver has nothing left?
After a handover the person owns no folders. Choosing them again shows an empty list in the same box and a problem saying they own nothing, and Transfer refuses with that message. The list area keeps its height either way.
Where does focus go?
Opening the dialog focuses Who is leaving. Transfer opens the alert on Cancel. Confirming closes both and puts focus back on Transfer files after a moment; a refused Transfer focuses the first folder that needs an owner.
What stays local, and how do I wire it?
The team, folders and owners are typed in the file and the owners change only in the drawing. To wire it, load the folders and members from your API and call a transfer endpoint from the confirm handler with the folder and new owner pairs. Do the move in one server transaction and check on the server that the caller may transfer them.