Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Account Delegation Account Block for React

The 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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Let people hand parts of their account to someone they trust, with this delegation panel for React with Base UI. A hairline frame with a plus mark on each corner holds a strip of three figures (delegates, pending invitations, who can change how you sign in) and a Table with a row for each delegate: an initials Avatar, the name and how they are related to you, and a Checkbox in each of four columns, View activity, Manage devices, Manage emails and Manage sign-in. A box takes effect on the spot and the foot says what changed. A pending invitation is a row too, showing what it offers and when it expires, with Resend and Withdraw. Removing a delegate asks first in an Alert Dialog. Under the table an invitation form takes an email and a role, and the role ticks the scopes it usually brings, which you can change. The header's Shine Button is the only colored control: it takes you to that form. Below the medium breakpoint each person is a card with the four scopes two by two. It's built from Table, Checkbox, Alert Dialog, Native Select, Field, Avatar, Badge, Button, Shine Button and Guides, with a CSS entrance only. For the security page of any app where one person can act for another.

FAQ

How do I fill it with my delegates?

Edit PEOPLE. Each has an id, a name and its two initials, an email, a relation such as Accountant, the scopes it holds from the four in SCOPES, and an expires day for an invitation that hasn't been accepted (leave it empty once it has). To change the scopes, edit SCOPES and the PRESETS that tick them in the invitation form. Counts, "expires 22 Oct" and "ends within 30 days" are worked out from these rows and the one AS_OF constant, never from the clock, so replace it with today's date when you wire it up.

What stays local, and how do I make it real?

Everything. A box, a removal, an invitation and a resend change this page's state and say so in the foot; nothing is sent and nobody gains or loses access. Undo walks the changes back one at a time, which a real server often can't. To make it real, call your endpoint in tick, confirm, resend and invite, change the row only when it answers, and show a failure in the same status line. Send the invitation email from your server: the form only checks the address.

What does a box do?

It grants or takes away one scope for that person straight away, and the strip updates: ticking Manage sign-in on someone moves the "Sign-in access" figure. There is no Save button, because each change is small and Undo is always in the foot. Taking away every scope leaves the person on the list with no access, so remove them if that is what you mean. A pending invitation's boxes are marks, not controls: the invitation grants what it was sent with, so withdraw it and invite again to change it.

How does the invitation form work?

Choose a role and the four boxes below are ticked for what it usually brings, say Accountant for View activity and Manage emails; tick or untick any of them and the role reads Custom. Send checks the address (empty, malformed, already on the list, or the list is full at five people) and at least one scope, puts the problem under the field and moves focus to it. A good invitation joins the matrix as a pending row and focus lands on its Withdraw button.

How does removing someone work?

Remove and Withdraw open an alert dialog that says what happens and that you can invite them again. Focus starts on Cancel, Escape closes it and focus returns to the button you pressed. After you confirm, focus moves to the next row's Remove button, or to Undo when nobody is left. The matrix keeps its height while people leave, and when it is empty a message in its own space offers to undo the last change.

How does it look on a phone, and is it accessible?

Each person becomes a card: the name and relation first, the four scopes two by two with their names visible, then the actions. The foot with the status line and Undo stays pinned to the bottom of the screen. Every box is named for the person and the scope ("Ines: Manage devices"), the table has a caption and column heads, an invitation's marks say "offered" or "not offered" in words, and the status line is a polite live region present from the start.

  • Pro

    Temporary 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

    Permissions Account

    Shared access

    A 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

    The 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.

  • Pro

    Memberships Account

    Organizations

    The organisations in an account as two tabs, Memberships and Invitations, with counts: leave asks first, an invitation is accepted into the other tab or declined, a managed membership says why it stays, and Undo.

  • Pro

    A 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

    Invite Team Dialog

    Share and invite

    A crew page with its bulk invite dialog shown open: a pasted list becomes one chip per address with bad ones flagged, one role for the batch, a seat meter that refuses a batch that does not fit, and a Pending tab with Resend, Revoke and Undo.