Transfer Ownership

Deliberately harder: consequences in plain words, armed by typing the name.

PROGet Transfer Ownership and 168 other Pro components with pro lifetime — Get Pro

Category
Workspace
Access
Pro
Source
389 lines · one file

The decision inside it

It earns its friction

“This action cannot be undone” is the sentence people have learned to click past. Three lines in the second person are not, and typing the workspace name is the only confirmation that cannot be completed by muscle memory.

When to use it

Use Transfer Ownership to hand a workspace to someone else: pick an eligible member (blocked ones say why), confirm by typing the workspace name, and say what role you keep.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Transfer Ownership for this.
Install it: npx shadcn@latest add @liro/transfer-ownership
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/transfer-ownership.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/transfer.tsx
import { TransferOwnership, type TransferCandidate } from "@/components/ui/transfer-ownership";

const candidates: TransferCandidate[] = [
  { id: "1", name: "Ada Moss", email: "ada@vertically.dev", role: "admin" },
  { id: "2", email: "guest@agency.io", role: "guest", blocked: "Guests can't own a workspace" },
];

export function Transfer({ transfer }: { transfer: (memberId: string) => void }) {
  return <TransferOwnership workspaceName="Madgixs" candidates={candidates} demotedTo="admin" onTransfer={(id) => transfer(id)} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
workspaceNamestring NoThe workspace being given away. Typed by the user to arm the button.
candidatesTransferCandidate[] NoWho may receive it. Owners are never in this list.
titlestring No–
demotedTostring NoWhat you become afterwards. Default "Admin".
onTransfer(id: string, candidate: TransferCandidate) => void No–
allowResetboolean NoHide the "Reset the demo" affordance in a real app.
lookLook NoLayered sets it in a tray, the heading above the card and the status in the strip below. Flat is one card.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-themeavatarrole-chip

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances