# Team invitations

Invite teammates and review consumer-owned invitation states with explicit resend and revoke requests.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs invite teammates and review consumer-owned invitation states with explicit resend and revoke requests.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than team invitations.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Team invitations

```sh
npx shadcn@latest add @tidal-pro/team-invitations
```

Stylesheets: `components/ui/tidal.css`, `components/ui/team-invitations.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/team-invitations.css";
import{TidalTeamInvitations}from"./components/ui/team-invitations";
export default(p:Parameters<typeof TidalTeamInvitations>[0])=><div className="tidal-scope"><TidalTeamInvitations {...p}/></div>;
```

## Structured props

- `TidalTeamInvitations.emailValue: string`: Required email value value accepted by this exported component.
- `TidalTeamInvitations.invitations: ReadonlyArray<TidalInvitationRecord>`: Required invitations value accepted by this exported component.
- `TidalTeamInvitations.onEmailChange: (value: string, event: ChangeEvent<HTMLInputElement>) => void`: Callback invoked when the email change interaction is proposed.
- `TidalTeamInvitations.onRoleChange: (value: string, event: ChangeEvent<HTMLSelectElement>) => void`: Callback invoked when the role change interaction is proposed.
- `TidalTeamInvitations.roles: ReadonlyArray<TidalInvitationRole>`: Required roles value accepted by this exported component.
- `TidalTeamInvitations.roleValue: string`: Required role value value accepted by this exported component.
- `TidalTeamInvitations.title: ReactNode`: Required title value accepted by this exported component.
- `TidalTeamInvitations.confirmation?: ReactNode`: Optional confirmation value accepted by this exported component.
- `TidalTeamInvitations.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalTeamInvitations.emailError?: ReactNode`: Optional email error value accepted by this exported component.
- `TidalTeamInvitations.emailInputProps?: InvitationEmailProps | undefined`: Optional email input props value accepted by this exported component.
- `TidalTeamInvitations.emailInputRef?: Ref<HTMLInputElement> | undefined`: Optional email input ref value accepted by this exported component.
- `TidalTeamInvitations.emailName?: string | undefined` (default "invitationEmail"): Optional email name value accepted by this exported component.
- `TidalTeamInvitations.emptyContent?: ReactNode`: Optional empty content value accepted by this exported component.
- `TidalTeamInvitations.error?: ReactNode`: Optional error value accepted by this exported component.
- `TidalTeamInvitations.formProps?: InvitationFormProps | undefined`: Optional form props value accepted by this exported component.
- `TidalTeamInvitations.formRef?: Ref<HTMLFormElement> | undefined`: Optional form ref value accepted by this exported component.
- `TidalTeamInvitations.headingLevel?: "h2" | "h3" | "h4" | "h5" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalTeamInvitations.inviting?: boolean | undefined` (default false): Optional inviting value accepted by this exported component.
- `TidalTeamInvitations.labels?: Partial<{ form: string; email: string; emailDescription: string; role: string; roleDescription: string; submit: string; submitting: string; list: string; pending: string; accepted: string; expired: string; revoked: string; sentAt: string; resend: string; revoke: string; loading: string; empty: string; invalid: string; }> | undefined`: Optional labels value accepted by this exported component.
- `TidalTeamInvitations.loading?: boolean | undefined` (default false): Optional loading value accepted by this exported component.
- `TidalTeamInvitations.loadingContent?: ReactNode`: Optional loading content value accepted by this exported component.
- `TidalTeamInvitations.onInviteRequest?: ((email: string, role: string, event: FormEvent<HTMLFormElement>) => void) | undefined`: Callback invoked when the invite request interaction is proposed.
- `TidalTeamInvitations.onResendRequest?: ((invitation: TidalInvitationRecord, event: React.MouseEvent<HTMLButtonElement>) => void) | undefined`: Callback invoked when the resend request interaction is proposed.
- `TidalTeamInvitations.onRevokeRequest?: ((invitation: TidalInvitationRecord, event: React.MouseEvent<HTMLButtonElement>) => void) | undefined`: Callback invoked when the revoke request interaction is proposed.
- `TidalTeamInvitations.pendingInvitationId?: string | undefined`: Optional pending invitation id value accepted by this exported component.
- `TidalTeamInvitations.roleError?: ReactNode`: Optional role error value accepted by this exported component.
- `TidalTeamInvitations.roleName?: string | undefined` (default "invitationRole"): Optional role name value accepted by this exported component.
- `TidalTeamInvitations.roleSelectProps?: InvitationRoleProps | undefined`: Optional role select props value accepted by this exported component.
- `TidalTeamInvitations.roleSelectRef?: Ref<HTMLSelectElement> | undefined`: Optional role select ref value accepted by this exported component.
- `TidalTeamInvitations.submitButtonProps?: InvitationSubmitButtonProps | undefined`: Optional submit button props value accepted by this exported component.
- `TidalTeamInvitations.submitButtonRef?: Ref<HTMLButtonElement> | undefined`: Optional submit button ref value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/team-invitations.tsx) | [Manifest](https://tidalui.com/examples/team-invitations.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useId, useRef, useState } from "react";

import { TidalAlertDialog } from "./components/ui/alert-dialog";

import { TidalTeamInvitations, type TidalInvitationRecord } from "./components/ui/team-invitations";

import "./components/ui/team-invitations.css";

import "./components/ui/alert-dialog.css";

import "./components/ui/input-group.css";

import "./components/ui/native-select.css";

import "./components/ui/status-badge.css";



const tidalExampleStyles = ".team-invitations-demo {\n  display: grid;\n  width: min(100%, 860px);\n  min-width: 0;\n  gap: 14px;\n}\n\n.team-invitations-demo-footer {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  justify-content: space-between;\n  gap: 14px;\n}\n\n.team-invitations-demo-footer output {\n  min-width: 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n.team-invitations-demo-footer button {\n  min-width: 44px;\n  min-height: 44px;\n  flex: none;\n  padding: 9px 13px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 650;\n  cursor: pointer;\n}\n\n.team-invitations-demo-footer button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n@media (max-width: 480px) {\n  .team-invitations-demo-footer {\n    display: grid;\n  }\n\n  .team-invitations-demo-footer button {\n    width: 100%;\n    font-size: 16px;\n  }\n}";

const INITIAL_INVITATIONS: readonly TidalInvitationRecord[] = [
  {
    id: "ava",
    email: "ava@example.com",
    role: "Member",
    status: "pending",
    sentAt: "Today, 9:20 AM",
    dateTime: "2026-10-15T09:20:00-05:00",
  },
  {
    id: "noah",
    email: "noah@example.com",
    role: "Reviewer",
    status: "accepted",
    sentAt: "October 12",
    dateTime: "2026-10-12",
  },
  {
    id: "mila",
    email: "mila@example.com",
    role: "Member",
    status: "expired",
    sentAt: "September 30",
    dateTime: "2026-09-30",
  },
];

const ROLES = [
  { value: "member", label: "Member" },
  { value: "reviewer", label: "Reviewer" },
  { value: "admin", label: "Admin" },
] as const;

export function TeamInvitationsDemo({
  theme = "light",
  dir = "ltr",
}: {
  theme?: "light" | "dark";
  dir?: "ltr" | "rtl";
}) {
  const generatedId = useId().replace(/:/g, "");
  const statusId = `${generatedId}-invitation-status`;
  const rootRef = useRef<HTMLElement>(null);
  const openerRef = useRef<HTMLButtonElement | null>(null);
  const nextInvitationId = useRef(0);
  const [invitations, setInvitations] =
    useState<readonly TidalInvitationRecord[]>(INITIAL_INVITATIONS);
  const [email, setEmail] = useState("rhea@example.com");
  const [role, setRole] = useState("member");
  const [revokeId, setRevokeId] = useState<string | null>(null);
  const [status, setStatus] = useState(
    "Fictional local invitations. No email or account request is active.",
  );
  const requested = invitations.find((item) => item.id === revokeId);

  return (
    <div className="team-invitations-demo" dir={dir}>
      <TidalTeamInvitations
        ref={rootRef}
        aria-describedby={statusId}
        title="Team invitations"
        description="Invite a sample teammate and review the invitation history."
        invitations={invitations}
        roles={ROLES}
        emailValue={email}
        roleValue={role}
        onEmailChange={setEmail}
        onRoleChange={setRole}
        onInviteRequest={(nextEmail, nextRole) => {
          const roleLabel =
            ROLES.find((option) => option.value === nextRole)?.label ??
            nextRole;
          setInvitations((current) => [
            {
              id: `local-${generatedId}-${++nextInvitationId.current}`,
              email: nextEmail,
              role: roleLabel,
              status: "pending",
              sentAt: "Just now",
              dateTime: "2026-10-15T12:00:00-05:00",
            },
            ...current,
          ]);
          setEmail("");
          setStatus(
            `${nextEmail} was added to this local sample. No email was sent.`,
          );
        }}
        onResendRequest={(invitation) => {
          setInvitations((current) =>
            current.map((item) =>
              item.id === invitation.id
                ? {
                    ...item,
                    status: "pending",
                    sentAt: "Just now",
                    dateTime: "2026-10-15T12:00:00-05:00",
                  }
                : item,
            ),
          );
          setStatus(
            `${invitation.email} was refreshed locally. No email was sent.`,
          );
        }}
        onRevokeRequest={(invitation, event) => {
          openerRef.current = event.currentTarget;
          setRevokeId(invitation.id);
        }}
      />
      <TidalAlertDialog
        open={requested !== undefined}
        onOpenChange={(open) => {
          if (!open) setRevokeId(null);
        }}
        trigger={
          <button type="button" hidden tabIndex={-1}>
            Confirm sample revocation
          </button>
        }
        title={`Revoke ${requested?.email ?? "sample invitation"}?`}
        description="This removes only the local sample row. It does not revoke account access or contact an email service."
        cancelLabel="Cancel"
        confirmLabel="Remove sample invitation"
        tone="danger"
        theme={theme}
        dir={dir}
        onCancel={() => setRevokeId(null)}
        onConfirm={() => {
          if (!requested) return;
          setInvitations((current) =>
            current.filter((item) => item.id !== requested.id),
          );
          setStatus(`${requested.email} was removed from this local sample.`);
          setRevokeId(null);
        }}
        contentProps={{
          onCloseAutoFocus: (event) => {
            event.preventDefault();
            const opener = openerRef.current;
            const fallback = rootRef.current?.querySelector<HTMLButtonElement>(
              "[data-invitation-action]:not(:disabled):not([aria-disabled='true'])",
            );
            const target =
              opener?.isConnected === true &&
              !opener.disabled &&
              opener.getAttribute("aria-disabled") !== "true"
                ? opener
                : (fallback ?? rootRef.current);
            openerRef.current = null;
            target?.focus({ preventScroll: true });
          },
        }}
      />
      <div className="team-invitations-demo-footer">
        <output id={statusId} aria-live="polite">
          {status}
        </output>
        <button
          type="button"
          onClick={() => {
            setInvitations(INITIAL_INVITATIONS);
            setEmail("rhea@example.com");
            setRole("member");
            setRevokeId(null);
            openerRef.current = null;
            setStatus("The fictional invitation sample was reset.");
          }}
        >
          Reset sample
        </button>
      </div>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <TeamInvitationsDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Requires title, consumer-owned invitation records with unique IDs/email/status, unique role options, controlled email/role values and change callbacks. Invitation states are pending, accepted, expired or revoked; resend and revoke actions appear only where applicable and call optional consumer handlers after unprevented native clicks. The native email/role form supports action, method, target and submitter overrides; with onInviteRequest it prevents navigation after the native onSubmit accepts the event, while without that callback native form submission remains available. Busy or normalized disabled submission is suppressed even when a form submit is dispatched directly. The owned fields stay in the invitation form and remain editable when available; native input/select/button prop bags and refs preserve caller-first prevented handlers, explicit aria-disabled=false and defensive unsafe-markup stripping. Loading, inviting and per-invitation pending states are controlled. Synchronous accepted action removal restores focus to a remaining action or the root without scrolling; confirmation remains an optional consumer-owned slot. Error, field error, loading, empty and localized label content plus native section attributes/ref and h2-h5 hierarchy are supported. Consumers own validation outcomes, confirmation, sending, membership, authentication, requests, storage and persistence. The component sends no email and changes no account.
