Invite people
Workspace invite form with a combobox directory field, comma and bulk-paste email validation, per-chip role menus, a live seat capacity meter, and shared-layout avatar flights into pending invites.
import { InvitePeople } from '@uthereal/ui/invite-people'Invite people playground
Invite people
Add teammates by email or pick them from the directory below.
- Emma CollinsProduct designer
- Marcus JohnsonFrontend engineer
- Sofia RamirezOperations lead
- Ava MitchellMarketing manager
- DDiane FosterAlready on the team
- NNathan ColeAlready on the team
Separate names with commas, semicolons, or Enter, or paste a list.
3 members1 pendingof 10 seats
Pending invites1 waiting
- Tyler HayesMember · tyler.hayes@fieldwork.exampleSent 2 days ago
Overview
InvitePeople provides a complete workspace invitation flow in one self-contained card. Users pick suggested teammates from a directory combobox, type addresses separated by commas or semicolons, or paste an entire list from a spreadsheet. Valid entries turn into chips with individual role menus; invalid, duplicate, or already-invited entries become editable error chips with plain-language reasons. A live seat meter tracks active members, pending invites, and queued selections against seatLimit, surfacing an over-limit upgrade notice when selections exceed plan capacity.
Use InvitePeople for workspace onboarding cards, invite modals, and seat-capped plan upgrade flows. For managing existing workspace members with inline search and confirm-to-remove, use Team members. For defining what each role can do, use Roles and permissions.
Usage
'use client'
import { InvitePeople } from '@uthereal/ui/invite-people'
export function WorkspaceInviteCard() {
return (
<InvitePeople
seatLimit={10}
onSendInvites={async (invites) => {
const res = await fetch('/api/workspace/invites', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ invites }),
})
if (!res.ok) throw new Error('Could not send invites')
}}
onResend={async (row) => {
await fetch(
`/api/workspace/invites/${encodeURIComponent(row.email)}/resend`,
{
method: 'POST',
},
)
}}
onRevoke={(row) => {
void fetch(`/api/workspace/invites/${encodeURIComponent(row.email)}`, {
method: 'DELETE',
})
}}
onUpgrade={() => {
window.location.assign('/settings/billing')
}}
/>
)
}Omit directory, members, defaultPending, and onSendInvites to render the default sample workspace with locally simulated delivery and a single accepted invite join flight (nothing is sent over the network).
Examples
Near seat capacity
Lower seatLimit to 5 against the default roster so selecting more than one additional person fills the seat bar, shifts the new-selection segment to danger tone, and reveals the over-limit Upgrade notice.
Invite to Starter workspace
4 of 5 seats are currently allocated. Selecting more than one person prompts an upgrade.
- Emma CollinsProduct designer
- Marcus JohnsonFrontend engineer
- Sofia RamirezOperations lead
- Ava MitchellMarketing manager
- DDiane FosterAlready on the team
- NNathan ColeAlready on the team
Separate names with commas, semicolons, or Enter, or paste a list.
3 members1 pendingof 5 seats
Pending invites1 waiting
- Tyler HayesMember · tyler.hayes@fieldwork.exampleSent 2 days ago
Custom roles and empty pending list
Supply a domain-specific roles catalog, set defaultRole to match one of its IDs, and pass custom directory, members, and an empty defaultPending array.
Invite collaborators
Assign editing or review permissions before sending.
- Nina PatelStaff writer
- Lucas MeyerDesign reviewer
- Tessa ChoManaging editor
Separate names with commas, semicolons, or Enter, or paste a list.
2 membersof 8 seats
Pending invites0 waiting
No pending invites right now.
Paste validation and seat limits
Pasting a list separated by commas, semicolons, newlines, or whitespace-delimited addresses tokenizes every entry in one pass. "Name <email>" formats and exact directory display names resolve automatically.
| Token condition | Chip outcome | Behavior |
|---|---|---|
| Directory name or valid new email | Valid chip | Assigned defaultRole with an inline role menu and remove button |
Already in members or defaultPending | Error chip | Flags the conflict ("already on the team" or "already has a pending invite") |
Missing @, local part, or full domain | Error chip | Explains the typo; click the chip to move its text back into the input |
| Duplicate of an existing chip | Skipped | Ignored silently and summarized in the live region announcement |
The seat bar (role="meter") layers three segments against seatLimit:
| Segment | Counted items | Over-limit behavior |
|---|---|---|
members | Active teammates in the header stack | Always counted as filled capacity |
pending | Unjoined pending invite rows | Decrements immediately on Revoke |
new | Valid chips queued in the invite field | Turns danger tone when total > seatLimit and opens the upgrade notice |
API reference
These serializable arguments and defaults come directly from the component schema.
| Argument | Type / default | Description |
|---|---|---|
title | stringDefault: "Invite people" | Card heading and accessible section name. |
description | stringDefault: "Add teammates by email or pick them from the directory below." | Supporting line below the heading. Pass an empty string (or null in React) to hide it. |
roles | InviteRoleItem[]Default: [{"id":"member","label":"Member","description":"Creates and edits projects"},{"id":"admin","label":"Admin","description":"Manages members and billing"},{"id":"billing","label":"Billing","description":"Views invoices and plans"},{"id":"viewer","label":"Viewer","description":"Views shared projects only"}] | Workspace roles offered by the per-chip role menu. Defaults to Member, Admin, Billing, and Viewer. |
directory | DirectoryPerson[]Default: [{"email":"diane.foster@fieldwork.example","name":"Diane Foster","title":"Chief operating officer"},{"email":"nathan.cole@fieldwork.example","name":"Nathan Cole","title":"Engineering manager"},{"email":"jasmine.brooks@fieldwork.example","name":"Jasmine Brooks","title":"Design lead"},{"email":"emma.collins@fieldwork.example","name":"Emma Collins","title":"Product designer"},{"email":"marcus.johnson@fieldwork.example","name":"Marcus Johnson","title":"Frontend engineer"},{"email":"sofia.ramirez@fieldwork.example","name":"Sofia Ramirez","title":"Operations lead"},{"email":"ava.mitchell@fieldwork.example","name":"Ava Mitchell","title":"Marketing manager"},{"email":"hannah.walsh@fieldwork.example","name":"Hannah Walsh","title":"Customer success"},{"email":"tyler.hayes@fieldwork.example","name":"Tyler Hayes","title":"Sales lead"}] | Directory teammates offered as suggestions while typing. Defaults to a nine-person sample. |
members | TeamMember[]Default: [{"email":"diane.foster@fieldwork.example","name":"Diane Foster","title":"Chief operating officer"},{"email":"nathan.cole@fieldwork.example","name":"Nathan Cole","title":"Engineering manager"},{"email":"jasmine.brooks@fieldwork.example","name":"Jasmine Brooks","title":"Design lead"}] | Teammates already on the workspace, shown in the header avatar stack and counted as filled seats. Defaults to a three-person sample. |
defaultPending | PendingInvite[]Default: [{"email":"tyler.hayes@fieldwork.example","name":"Tyler Hayes","title":"Sales lead","role":"member","note":"Sent 2 days ago"}] | Pending invite rows present when the block mounts. Defaults to one sample invite. |
seatLimit | integerDefault: 10 | Total seats on the current plan. The seat bar counts members, pending invites, and new selections against it. |
defaultRole | stringDefault: "member" | Role assigned to chips added without an explicit choice. Must match one of roles. |
sendAction | string— | Registered host action requested when the user activates Send invites. |
resendAction | string— | Registered host action requested when the user activates Resend on a pending invite. |
revokeAction | string— | Registered host action requested when the user activates Revoke on a pending invite. |
upgradeAction | string— | Registered host action requested when the user activates Upgrade from the over-limit notice. |
recipe | studio | softDefault: "studio" | Visual treatment. Both recipes preserve interaction behavior. |
theme | InvitePeopleThemeDefault: {} | Color mode, accent, and typed semantic token overrides. |
motion | none | subtle | expressiveDefault: "subtle" | Animation preset. System reduced-motion preferences take precedence. |
motionOptions | InvitePeopleMotionOptionsDefault: {} | Chip flight, field reflow, status swap, and shake timing overrides in milliseconds. |
dir | ltr | rtl— | Reading direction; inherited from the page when omitted. |
InviteRoleItemaccepts{ id, label, description }with uniqueidvalues;defaultRolemust match one of them.DirectoryPersonandTeamMemberaccept{ email, name?, title?, avatarUrl? }.PendingInviteaccepts{ email, name?, title?, avatarUrl?, role?, note? }.
React integration
| Prop | Purpose |
|---|---|
onSendInvites(invites) | Called with { email, role }[] on Send. Return a Promise to hold the Sending… state until it settles; omit for simulated delivery. |
onResend(row) | Called with the pending row on Resend. Return a Promise to hold Sending… until delivery completes. |
onRevoke(row) | Called with the pending row when Revoke removes it and frees its seat. |
onUpgrade() | Called when Upgrade is activated inside the over-limit notice. |
onAction(action, context) | Called with sendAction, resendAction, revokeAction, or upgradeAction and the affected email list or email address. |
description | Also accepts null or "" in React to hide the subtitle beneath the heading. |
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 |
|---|---|
ArrowDown / ArrowUp (in field) | Opens suggestions and wraps across enabled options, skipping people already on the team or invited. |
Enter | Picks the highlighted suggestion, or commits the typed text into a chip. |
, / ; | Commits the typed text as a chip. |
Backspace (on empty input) | First press arms the last chip with a danger outline and live cue; second press removes it. |
Escape | Closes the suggestion listbox first, then clears typed text on a second press. |
ArrowDown (on chip role button) | Opens the per-chip role="menu" and focuses the active menuitemradio. |
ArrowUp / ArrowDown / Home / End / Escape (in menu) | Navigates role choices; Escape closes the menu and restores focus to the role button. |
- The invite field exposes
role="combobox"witharia-expanded,aria-controls,aria-autocomplete="list", andaria-activedescendantpointing into arole="listbox"where unavailable people carryaria-disabled="true". - The Send button remains focusable with
aria-disabled="true"while blocked, pointingaria-describedbyat the error list or seat summary. Activating it while blocked focuses the empty input, shakes invalid chips, or nudges the over-limit notice while announcing the reason in a pre-mounted politerole="status"live region. - Container queries adapt the card below
440pxby moving each pending row's status under the invitee name and hiding suggestion titles; below480pxviewport width, card padding tightens to16px. All spacing and menu edges use logical CSS properties for RTL (dir="rtl"), and@media (forced-colors: active)maps borders, seats, and error chips to system colors.
Motion & theming
Avatars share a scoped layoutId inside LayoutGroup, so a person's avatar glides from the suggestion listbox into the chip, from the chip into the pending invite row, and from a joined row into the header team stack on the morph spring (420ms). Error panels, over-limit notices, and pending rows enter and reflow on the bounce-free smooth spring (400ms), and activating Send while blocked shakes invalid chips or the over-limit notice.
Under prefers-reduced-motion: reduce, layout travel, scale, shakes, and spinner rotation turn off while panels keep 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 |
accentTones | --ui-accent-strong, --ui-accent-subtle |
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, InvitePeople is a leaf block. Configure roles, directory, members, defaultPending, seatLimit, and registered host actions (sendAction, resendAction, revokeAction, upgradeAction). See Building with agents.
{
"type": "InvitePeople",
"props": {
"title": "Invite people",
"description": "Add teammates by email or pick them from the directory below.",
"seatLimit": 10,
"defaultRole": "member",
"sendAction": "send_workspace_invites",
"resendAction": "resend_workspace_invite",
"revokeAction": "revoke_workspace_invite",
"upgradeAction": "upgrade_workspace_plan"
},
"children": []
}