shadcn.io is not affiliated with official shadcn/ui
Team Members Account Block for React
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.
Installation
Overview
Show who can sign in to a shared account and who is not protected, with this team panel for React with Base UI. A hairline frame with a plus mark on each corner holds tiles, three across, one per person: an initials Avatar, the name and email, a Native Select for the role, a shield and the words "Two-factor on" or "off", and the day of the last sign-in. People without two-factor sort first, and a band above counts them ("2 members have not turned on two-factor") with one outline button that queues a reminder. A tile's Dropdown Menu resends a sign-in link or removes the member, which asks first in an Alert Dialog. Under the tiles sit the pending invitations, each with Resend and Withdraw, and a form that invites an email with a role. The header's Shine Button is the only colored control: it takes you to that form. Every change says so in a line at the foot and Undo walks back the last one. It's built from Native Select, Dropdown Menu, Alert Dialog, Field, Avatar, Button, Shine Button and Guides, with a CSS entrance only. For the account page of any app that several people sign in to.
FAQ
How do I fill it with my team?
Edit MEMBERS (an id, a name and its two initials, an email, a role of Owner, Admin, Editor or Viewer, the ISO day of the last sign-in and whether two-factor is on as tfa) and INVITES (an email, the role it offers and the ISO sent and expires days). The count of people without two-factor, the sort order and "yesterday" are worked out from those rows and the one AS_OF constant, never the clock, so replace it with today's date when you wire it up. The team has SEATS seats, members and invitations together.
What stays local, and how do I make it real?
Everything. Changing a role, queuing a reminder, resending a link, inviting, withdrawing and removing change this page's state and say so in the foot; nothing is sent and nobody is told. Undo walks the changes back, which a real server can't always do. To make it real, call your endpoints in setRoleOf, remind, resendLink, invite, withdraw and remove, change a tile only when they answer, and put a failure in the same status line. Sending the reminder and the invitation belongs to your server: the form only checks the address.
How does the two-factor nudge work?
The band counts the members whose two-factor is off, and Send a reminder queues one for each of them at once; their tiles then read "Two-factor off, reminded" and the button turns quiet and says "Reminder queued". The shield and the words carry the state, never a colour. Members without two-factor sort to the front so they can't be missed, and the owner can't be removed or have their role changed from here.
How does removing someone work?
Remove member in a tile's menu opens an alert dialog that says the member can no longer sign in, that the seat frees up and that their work stays. Focus starts on Cancel, Escape closes it and focus returns to the tile's menu button. After you confirm, focus goes to the next tile's menu button. The tile is replaced by an empty seat, so the grid keeps its height, and the first empty seat says so.
How does it look on a phone?
The tiles go one across, each with the same height, and the nudge band stacks its button under the sentence. The foot with the status line and Undo stays pinned to the bottom of the screen, so the result of a change is always in view. The invitation form stacks its fields.
Is it accessible?
The tiles are a real list. Every role select is named for the person ("Role for Maren Dahlquist"), the menu buttons say whose menu they open, the shield is hidden from assistive technology because the words are beside it, and emails keep their reading order in a right-to-left page. Problems under the invitation field are announced and linked to it, and the status line is a polite live region present from the start.
Related
- 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
Memberships Account
OrganizationsThe 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
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 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
Multi-Factor Authentication Settings
Sign-in and securityA multi-factor policy settings panel with choice cells for who must use it, allowed methods with a keep-one guard, a grace period that prints the start day, and a coverage meter that draws the people who have not set one up.
- Pro
Invite Team Dialog
Share and inviteA 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.