Usage
import { SaasTeam } from './SaasTeam.jsx'
// Without callbacks each action resolves after a short wait. Wire them to your API:
<SaasTeam
locale="en"
members={members} // [{ id, name, email, role, you? }], role: 'owner' | 'admin' | 'editor' | 'viewer'
invites={invites} // [{ id, email, role }]
seats={{ used: 6, limit: 8 }}
canManage={me.role === 'owner' || me.role === 'admin'}
onInvite={async (email, role) => (await api.invite(email, role)).invite ?? false}
onRoleChange={(id, role) => api.setRole(id, role)}
onRemove={(id) => api.remove(id)}
onRevoke={(id) => api.revoke(id)}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text and sample team. |
members / invites | Array<{ id, name, email, role, you? }> / Array<{ id, email, role }> | sample team | The people and the invites still waiting. The owner and the row marked `you` cannot be changed or removed. No members shows the empty state. |
roles | string[] | ['admin', 'editor', 'viewer'] | The roles that can be given, in order; their names come from `labels.roles`. |
seats | { used, limit } | members + invites of 8 | The plan’s seats. When every seat is taken the invite button rests and says why. |
canManage | boolean | true | False hides the invite form and shows roles as plain text, for members who may only look. |
loading / error | boolean / boolean | string | false | The skeleton while the team loads; the error banner with retry (a string replaces its sentence). |
onInvite | (email, role) => Promise<{ id, email, role } | false | void> | — | Sends an invite. Resolve the saved invite to list it, or false to keep the form with an error. |
onRoleChange / onRemove / onRevoke / onRetry | (id, role) => Promise / (id) => Promise / (id) => Promise / () => void | — | Saves a new role, removes a member, takes back an invite, retries after an error. Resolve false to leave things as they were. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
SaasTeam.jsxsaas-team.csscopy.jskit.jsxkit.cssui/base-button/ui/two-step-button/ui/avatar-group/ui/empty-state/ui/status-tag/ui/alert-banner/ui/select/ui/text-input/ui/skeleton-shimmer/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.