Skip to content
Eskais UI

Accounts

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

npx shadcn@latest add @eskais/invitation-panel
npm packages@standard-schema/spec@1.1.0react-hook-form@7.91.0lucide-react

Usage

Import
import { invitationPanel } from "@/components/ui/invitation-panel-primitive"import { InvitationNewLink } from "@/components/ui/invitation-panel-link"import { useInvitationExpiry } from "@/components/ui/use-invitation-expiry"import { InvitationPanel, invitationPanelLabels } from "@/components/ui/invitation-panel"

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

PropTypeDefault
localerequiredstring | undefined–
linkrequiredInvitationLinkState–
urlrequiredstring | undefined–
copiedrequiredboolean–
textrequiredInvitationPanelText–
labelsrequiredInvitationPanelLabels–
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 InvitationRequest

Accessibility

  • 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.