Team members
Workspace members management block with a multi-email chip invite bar that flies chips into pending invites as seats roll, live search and role filtering, per-row role selects, and inline confirm-to-remove.
import { TeamMembers } from '@uthereal/ui/team-members'Team members playground
Team members
7 of 12 seats
Members 5
Pending invites 2
Overview
TeamMembers manages a workspace roster from a single settings card. The header pairs the title with a rolling seat meter (used of seatLimit). Below it, a multi-email chip bar accepts typed or pasted addresses with a shared role selector and flies submitted email chips directly into the Pending invites list. The Members section filters live by search query and role, displays avatars and localized relative last-active timestamps, provides inline role selectors (locking owner rows), and swaps any removable member row into a two-step Cancel / Remove confirmation bar.
Use TeamMembers on SaaS workspace or organization settings pages that combine member administration with quick email invites. For a directory-backed invite flow with per-person roles and an upgrade banner, use Invite people. For editing permission matrices per role, use Roles and permissions.
Usage
'use client'
import {
TeamMembers,
type TeamInvite,
type TeamMember,
} from '@uthereal/ui/team-members'
export function WorkspaceMembersSettings({
members,
invites,
onMembersChange,
onInvitesChange,
}: {
members: TeamMember[]
invites: TeamInvite[]
onMembersChange: (next: TeamMember[]) => void
onInvitesChange: (next: TeamInvite[]) => void
}) {
return (
<TeamMembers
members={members}
invites={invites}
seatLimit={12}
onMembersChange={onMembersChange}
onInvitesChange={onInvitesChange}
onInvite={async (emails, role) => {
const res = await fetch('/api/team/invites', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ emails, role }),
})
if (!res.ok) throw new Error('Invite failed')
}}
onRoleChange={(member, role) => {
void fetch(`/api/team/members/${member.id}`, {
method: 'PATCH',
body: JSON.stringify({ role }),
})
}}
onRemove={(member) => {
void fetch(`/api/team/members/${member.id}`, { method: 'DELETE' })
}}
/>
)
}Omit members, invites, and onInvite to render the default five-member sample workspace with two pending invites and locally simulated delivery (nothing is sent over the network).
Examples
At seat capacity
Set seatLimit equal to defaultMembers.length + defaultInvites.length to display the full-capacity warning tone on the seat meter and invite message until a member is removed or a pending invite is revoked.
Core team
All plan seats are occupied. Remove a member or revoke an invite to free a slot.
5 of 5 seats
Members 4
Pending invites 1
Custom roles without search
Disable searchable, supply a custom roles list, and pass an empty defaultInvites array for compact repository or project rosters.
Project collaborators
Manage repository access without a search bar.
3 of 8 seats
Members 3
Pending invites 0
Invite bar and member controls
Invite bar tokenization
| Input event | Behavior |
|---|---|
, / ; / Space | Commits the current draft into validated email chips; incomplete text remains in the field |
Enter | Commits typed text when present, or submits all queued chips when the input is empty |
| Paste (multiple tokens) | Splits on commas, semicolons, and whitespace; rejects duplicates against members and invites |
Backspace (empty input) | Removes the last email chip immediately |
Blur | Auto-commits a complete email address left in the input |
Roster row states
| Section / state | Composed controls | Behavior |
|---|---|---|
| Member row (default) | Avatar, MorphSelect, Button | Shows display name (isYou adds youLabel), email, relative lastActive, role select, and remove button |
Owner row (isOwner) | Avatar + static role label | Locks role text aligned with sibling role pickers and hides the remove button |
| Inline confirm state | Cancel outline button + Remove danger button | Swaps in place with a danger row tint, moves focus to Cancel, and closes on Escape |
| Pending invite row | Dashed initials badge + Resend / Revoke buttons | Catches flying email chips via shared layoutId; Resend shows loading then brief Sent tick |
API reference
These serializable arguments and defaults come directly from the component schema.
| Argument | Type / default | Description |
|---|---|---|
title | stringDefault: "Team members" | Heading and accessible section name. |
description | string— | Supporting line below the heading. Pass an empty string (or null in React) to hide it. |
roles | TeamRole[]Default: [{"id":"owner","label":"Owner"},{"id":"admin","label":"Admin"},{"id":"member","label":"Member"},{"id":"viewer","label":"Viewer"}] | Selectable workspace roles with stable ids and labels. Owners keep their role locked. |
defaultMembers | TeamMember[]Default: [{"id":"emma","name":"Emma Collins","email":"emma@fieldnote.example","role":"owner","isOwner":true,"isYou":true,"lastActive":"2026-11-29T09:41:00Z"},{"id":"ava","name":"Ava Mitchell","email":"ava@fieldnote.example","role":"admin","lastActive":"2026-11-29T09:38:00Z","isOwner":false,"isYou":false},{"id":"marcus","name":"Marcus Johnson","email":"marcus@fieldnote.example","role":"member","lastActive":"2026-11-29T07:40:00Z","isOwner":false,"isYou":false},{"id":"jasmine","name":"Jasmine Brooks","email":"jasmine@fieldnote.example","role":"member","lastActive":"2026-11-28T16:12:00Z","isOwner":false,"isYou":false},{"id":"sofia","name":"Sofia Ramirez","email":"sofia@fieldnote.example","role":"viewer","lastActive":"2026-11-14T18:00:00Z","isOwner":false,"isYou":false}] | Initial member rows when uncontrolled. Defaults to a five-person sample team. Edits do not reset a mounted instance. |
defaultInvites | TeamInvite[]Default: [{"id":"jordan","email":"jordan.blake@fieldnote.example","role":"member","sentAt":"2026-11-19T14:00:00Z"},{"id":"priya","email":"priya.shah@harborline.studio","role":"viewer","sentAt":"2026-11-20T10:30:00Z"}] | Initial pending invites when uncontrolled. Defaults to two sample addresses. Edits do not reset a mounted instance. |
seatLimit | integerDefault: 12 | Total seats counting members and pending invites; shown in the rolling seat meter. |
searchable | booleanDefault: true | Show the live member search in the lists header. |
searchPlaceholder | stringDefault: "Search by name or email" | Placeholder text inside the search input. |
allRolesLabel | stringDefault: "All roles" | Label of the role filter option showing every role. |
inviteLabel | stringDefault: "Invite people" | Visible label of the invite field. |
sendLabel | stringDefault: "Send invite" | Label of the send button; shows a count for bulk invites. |
resendLabel | stringDefault: "Resend" | Label of each pending invite resend action. |
revokeLabel | stringDefault: "Revoke" | Label of each pending invite revoke action. |
cancelLabel | stringDefault: "Cancel" | Label canceling the confirm-to-remove state. |
removeLabel | stringDefault: "Remove" | Label confirming a member removal. |
removeQuestionLabel | stringDefault: "Remove {name}?" | Confirm-to-remove heading template; {name} fills the member name. |
removeDetailLabel | stringDefault: "They lose access to the workspace right away" | Supporting line inside the confirm state. |
youLabel | stringDefault: "You" | Badge marking the viewer’s own row. |
membersLabel | stringDefault: "Members" | Heading of the member list section. |
pendingLabel | stringDefault: "Pending invites" | Heading of the pending invites section. |
seatsLabel | stringDefault: "{used} of {limit} seats" | Seat counter template; {used} fills seats taken, {limit} the limit. |
inviteHintLabel | stringDefault: "Separate addresses with commas or press Enter. Invites expire in 7 days" | Hint under the invite field at rest. |
seatsFullLabel | stringDefault: "All {limit} seats are taken" | Warning when every seat is in use. |
seatsLeftLabel | stringDefault: "{count} {noun} left" | Seat capacity note with a singular or plural noun. |
overLimitLabel | stringDefault: "Remove {count} {noun} to send" | Warning when typed chips exceed the seats left. |
invalidEmailLabel | stringDefault: "“{value}” is not a complete email address" | Error for a token that is not a valid address. |
duplicateMemberLabel | stringDefault: "{name} is already a member" | Error when a member is invited again. |
duplicateInviteLabel | stringDefault: "{email} already has a pending invite" | Error when an address is already invited. |
emptyInviteLabel | stringDefault: "Add at least one email address" | Error when sending with an empty field. |
noMembersLabel | stringDefault: "No members match “{query}”" | Empty member list state; {query} fills the search. |
noInvitesLabel | stringDefault: "No pending invites" | Empty pending list state. |
clearSearchLabel | stringDefault: "Clear search" | Label of the empty-state action clearing the search. |
roleChangedLabel | stringDefault: "{name} is now {article} {role}" | Status after a role change. |
invitedLabel | stringDefault: "Invited {email} as {article} {role}" | Status after a single invite lands. |
invitedManyLabel | stringDefault: "Invited {count} people as {article} {role}" | Status after a bulk invite lands. |
removedLabel | stringDefault: "{name} was removed from the workspace" | Status after a member removal. |
resentLabel | stringDefault: "Invite resent to {email}" | Status after a resend completes. |
revokedLabel | stringDefault: "Invite to {email} revoked" | Status after an invite revocation. |
sentJustNowLabel | stringDefault: "Invited just now" | Sent label for invites that just landed. |
resentJustNowLabel | stringDefault: "Resent just now" | Sent label updated after a resend. |
sentLabel | stringDefault: "Sent" | Label shown briefly after a resend completes. |
inviteAction | string— | Registered host action requested when invites are sent; fires once per address. |
roleChangeAction | string— | Registered host action requested when a member’s role changes. |
removeAction | string— | Registered host action requested when a member removal is confirmed. |
resendAction | string— | Registered host action requested when an invite is resent. |
revokeAction | string— | Registered host action requested when an invite is revoked. |
locale | string— | BCP 47 locale for relative last-active and sent labels; inherited when omitted. |
recipe | studio | softDefault: "studio" | Visual treatment. Both recipes preserve interaction behavior. |
theme | TeamMembersThemeDefault: {} | Color mode, accent, and typed semantic token overrides. |
motion | none | subtle | expressiveDefault: "subtle" | Animation preset. System reduced-motion preferences take precedence. |
motionOptions | TeamMembersMotionOptionsDefault: {} | Row, flight, height, and copy swap timing overrides in milliseconds. |
dir | ltr | rtl— | Reading direction; inherited from the page when omitted. |
TeamRoleaccepts{ id, label }with uniqueidvalues.TeamMemberaccepts{ id, name, email, role, avatar?, lastActive?, isOwner?, isYou? };rolemust match a configured role ID andlastActiveaccepts an ISO-8601 timestamp.TeamInviteaccepts{ id, email, role, sentAt? };defaultMembers.length + defaultInvites.lengthmust not exceedseatLimit.
React integration
| Prop | Purpose |
|---|---|
members | Controlled member rows. Omit for uncontrolled state seeded by defaultMembers. |
onMembersChange(members) | Called with the updated member list after role changes or confirmed removals. |
invites | Controlled pending invite rows. Omit for uncontrolled state seeded by defaultInvites. |
onInvitesChange(invites) | Called with the updated pending list after invites land, resend, or revoke. |
onInvite(emails, role) | Called when invites are submitted. Return a Promise to hold the sending spinner until it settles; rejections show an inline error. |
onRoleChange(member, role) | Called when a member's role is updated from its inline select. |
onRemove(member) | Called when the user confirms removal inside the inline confirm bar. |
onResend(invite) | Called when Resend is activated. Return a Promise to hold loading until delivery settles. |
onRevoke(invite) | Called when Revoke removes a pending invite and frees a seat. |
onAction(action, itemId) | Called with inviteAction, roleChangeAction, removeAction, resendAction, or revokeAction and the email, member ID, or invite ID. |
description | Also accepts null or "" in React to hide the subtitle beneath the heading. |
portalContainer | Portal target forwarded to every MorphSelect role picker. |
preset | Application defaults overridden by explicit instance arguments. |
tokens | CSS variables applied after the typed theme. |
ref, className, style | Applied to the root <section> element. |
| Native attributes | id, aria-*, data-*, and remaining <section> props forwarded to the root element. |
Keyboard & accessibility
| Key | Action |
|---|---|
Enter | Commits a typed email into a chip, or submits all queued chips when the input is empty. |
, / ; / Space | Turns the typed email address into a chip. |
Backspace (on empty invite input) | Removes the last queued email chip. |
Escape (in confirm state) | Cancels pending member removal and returns focus to that row's remove button. |
Tab | Moves across the invite field, role select, send button, search, role filter, and row actions. |
- Rolling counters (
RollingNumber) for seats used, member count, and pending invite count are markedaria-hidden="true"and paired with visually hidden full-text values so screen readers read"7 of 12 seats"instead of individual digits. - The seat bar exposes
role="meter"witharia-valuemin,aria-valuemax,aria-valuenow, andaria-valuetext. - Opening inline confirm-to-remove focuses Cancel automatically; confirming a removal or revoking an invite moves focus cleanly to the neighboring row's action button (or falls back to the search or invite input when the list empties).
- Invite validation messages render in a polite
aria-live="polite"slot referenced byaria-describedby, and a pre-mountedrole="status"live region in the footer announces role changes, invites, removals, resends, and revocations. - Container queries adapt at five breakpoints: below
760pxthe footer stacks; below640pxlast-active moves inline under email; below600pxheader, invite controls, and search stack full width; below480pxconfirm and pending rows stack vertically; below420pxmember rows split identity above activity, role, and remove. Logical CSS properties support RTL (dir="rtl"), and@media (forced-colors: active)preserves borders and seat meter contrast.
Motion & theming
Submitted email chips share a scoped layoutId with their target pending invite row inside LayoutGroup, flying smoothly into place on the morph spring (420ms) while a landing highlight fades out over 600ms. Seat counts and section badges roll digit-by-digit (RollingNumber), measured rows expand and collapse on the bounce-free smooth spring (400ms), and status or confirm copy swaps rise through a soft blur.
Under prefers-reduced-motion: reduce, chip flights, row travel, blur, and landing animations turn off while status copy keeps a 120ms opacity crossfade. Setting motion="none" makes every transition immediate (0ms).
theme accepts mode, accent, and typed tokens across these groups:
| Token group | CSS custom properties |
|---|---|
core | --ui-surface, --ui-surface-raised, --ui-text, --ui-text-secondary, --ui-muted, --ui-border, --ui-highlight, --ui-accent, --ui-accent-foreground, --ui-danger, --ui-focus-ring, --ui-radius, --ui-border-width, --ui-shadow, --ui-disabled-opacity, --ui-font, --ui-font-size, --ui-font-weight |
extended | --ui-surface-sunken, --ui-border-strong, --ui-border-subtle, --ui-track, --ui-info, --ui-success, --ui-warning, --ui-tone-foreground, --ui-overlay, --ui-tint-strength |
shape | --ui-radius-sm, --ui-popup-radius, --ui-surface-radius |
control | --ui-control-height, --ui-control-padding-x, --ui-control-gap, --ui-icon-size |
An application-wide UtherealProvider supplies defaults.
Composition
In an agent composition, TeamMembers is a leaf block. Keep every member and invite role inside roles, keep defaultMembers.length + defaultInvites.length <= seatLimit, and wire only registered host actions. See Building with agents.
{
"type": "TeamMembers",
"props": {
"title": "Team members",
"description": "Manage who has access to this workspace.",
"seatLimit": 12,
"searchable": true,
"inviteAction": "invite_team_member",
"roleChangeAction": "change_member_role",
"removeAction": "remove_team_member",
"resendAction": "resend_team_invite",
"revokeAction": "revoke_team_invite"
},
"children": []
}