UI

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.

Separate names with commas, semicolons, or Enter, or paste a list.

3 members1 pendingof 10 seats

Add people by email or from the directory

Pending invites1 waiting

  • Tyler HayesMember · tyler.hayes@fieldwork.exampleSent 2 days ago
Loading interactive preview…

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.

Separate names with commas, semicolons, or Enter, or paste a list.

3 members1 pendingof 5 seats

Add people by email or from the directory

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.

Separate names with commas, semicolons, or Enter, or paste a list.

2 membersof 8 seats

Add people by email or from the directory

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 conditionChip outcomeBehavior
Directory name or valid new emailValid chipAssigned defaultRole with an inline role menu and remove button
Already in members or defaultPendingError chipFlags the conflict ("already on the team" or "already has a pending invite")
Missing @, local part, or full domainError chipExplains the typo; click the chip to move its text back into the input
Duplicate of an existing chipSkippedIgnored silently and summarized in the live region announcement

The seat bar (role="meter") layers three segments against seatLimit:

SegmentCounted itemsOver-limit behavior
membersActive teammates in the header stackAlways counted as filled capacity
pendingUnjoined pending invite rowsDecrements immediately on Revoke
newValid chips queued in the invite fieldTurns danger tone when total > seatLimit and opens the upgrade notice

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
titlestringDefault: "Invite people"Card heading and accessible section name.
descriptionstringDefault: "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.
rolesInviteRoleItem[]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.
directoryDirectoryPerson[]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.
membersTeamMember[]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.
defaultPendingPendingInvite[]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.
seatLimitintegerDefault: 10Total seats on the current plan. The seat bar counts members, pending invites, and new selections against it.
defaultRolestringDefault: "member"Role assigned to chips added without an explicit choice. Must match one of roles.
sendActionstring—Registered host action requested when the user activates Send invites.
resendActionstring—Registered host action requested when the user activates Resend on a pending invite.
revokeActionstring—Registered host action requested when the user activates Revoke on a pending invite.
upgradeActionstring—Registered host action requested when the user activates Upgrade from the over-limit notice.
recipestudio | softDefault: "studio"Visual treatment. Both recipes preserve interaction behavior.
themeInvitePeopleThemeDefault: {}Color mode, accent, and typed semantic token overrides.
motionnone | subtle | expressiveDefault: "subtle"Animation preset. System reduced-motion preferences take precedence.
motionOptionsInvitePeopleMotionOptionsDefault: {}Chip flight, field reflow, status swap, and shake timing overrides in milliseconds.
dirltr | rtl—Reading direction; inherited from the page when omitted.
  • InviteRoleItem accepts { id, label, description } with unique id values; defaultRole must match one of them.
  • DirectoryPerson and TeamMember accept { email, name?, title?, avatarUrl? }.
  • PendingInvite accepts { email, name?, title?, avatarUrl?, role?, note? }.

React integration

PropPurpose
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.
descriptionAlso accepts null or "" in React to hide the subtitle beneath the heading.
presetApplication defaults overridden by explicit instance arguments.
tokensCSS variables applied after the typed theme.
ref, className, styleApplied to the root <section> element.
Native attributesid, aria-*, data-*, and remaining <section> props forwarded to the root element.

Keyboard & accessibility

KeyAction
ArrowDown / ArrowUp (in field)Opens suggestions and wraps across enabled options, skipping people already on the team or invited.
EnterPicks 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.
EscapeCloses 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" with aria-expanded, aria-controls, aria-autocomplete="list", and aria-activedescendant pointing into a role="listbox" where unavailable people carry aria-disabled="true".
  • The Send button remains focusable with aria-disabled="true" while blocked, pointing aria-describedby at 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 polite role="status" live region.
  • Container queries adapt the card below 440px by moving each pending row's status under the invitee name and hiding suggestion titles; below 480px viewport width, card padding tightens to 16px. 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 groupCSS 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": []
}

On this page