Invitation Panel
InvitationPanel: an admin creates an invitation and gets a one-time link, shown once with a copy button, a live expiry countdown that switches to expired, and a revoke behind a confirmation; below, the pending invitations with role, creator, expiry and revoke, through DataState. Agents can create, copy and revoke, and never read the link.
Example
Installation
@standard-schema/spec@1.1.0react-hook-form@7.91.0lucide-reactUsage
An admin's invite screen: onCreate returns the one-time link, which the panel shows once; pending invitations come from your API without their links, with DataState's status for loading and errors.
API reference
InvitationNewLink
| Prop | Type | Default |
|---|---|---|
localerequired | string | undefined | – |
linkrequired | InvitationLinkState | – |
urlrequired | string | undefined | – |
copiedrequired | boolean | – |
textrequired | InvitationPanelText | – |
labelsrequired | InvitationPanelLabels | – |
onCopyrequired | (event: Event) => void | – |
onRevokerequired | (event: Event) => void | – |
onDismissrequired | () => void | – |
onExpirerequired | () => void | – |
InvitationPanel
Takes InvitationPanelProps<Schema>.
Other exports
invitationPaneluseInvitationExpiryinvitationPanelLabelstype InvitationCreatedtype InvitationLinktype InvitationLinkStatetype InvitationPanelOptionstype InvitationPanelStatetype InvitationRoletype Invitationtype InvitationPanelLabelstype InvitationPanelPropstype InvitationPanelTexttype InvitationRequestAccessibility
- Creating announces that a link was created, and copying that it was copied, never the link itself.
- The new link is a region named by its heading; the expiry is a time element that counts down and reads Expired when it passes.
- Each pending row's Revoke is named for its invitee, or its role, creator and expiry, so no two share a name; it opens an alert dialog before anything is revoked.
Agent actions
Agents call create (with a role), copy and revoke(id) on the panel, and read the new link's id and expiry from its state, never its URL. revoke opens the confirmation, whose button needs a person; copy with no fresh link, an unknown id or a role the panel doesn't offer fails the step with why.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.