Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-invite-dialog.json --yes

Invite dialog

Pro

Send an invite to people by their email addresses, with a role and an optional note, for React and Tailwind CSS. Part of Goop Pro.

Open "Invite people": the addresses take the focus. Type an address and press Enter or a comma, or paste a list (commas, semicolons, new lines, "Name <address>"); one that is no address is marked and named under the field, and Backspace twice removes the last tag. Pick a role (Enter opens its list, the arrows move), add a note, then ⌘ Enter or Send: the button is busy for a moment and the people join the pending list. An address invited already is refused in place. The line under the list says while the dialog is open and the addresses it holds. The send is a timer; nothing is emailed, and the invites live in the page only.

When to use

  • Send an invite to people by their email addresses, with a role and an optional note.
  • Use it for every "Invite" on a members page, a team's settings or a share menu: people are invited by address, so the dialog never asks for a name or a form of one field per person. Put the roles a person may join as in roles, each with a description; give inviteLink the theme's CopyButton when the workspace has a link to share. In onSend, refuse an address already a member or invited by throwing an Error that names it: the dialog shows it and stays open. Say the invites went with a Toast after it closes.

When not to use

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Invite dialog on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-invite-dialog.json --yes
PROMPT
Add the Goop Invite dialog to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { InviteDialog } from '@/components/goop/patterns/invite-dialog';
import { useState } from 'react';
import { Button, ButtonIcon, ButtonLabel } from '@/components/ui/goop/button';
import { CopyButton } from '@/components/ui/goop/copy-button';
import { toast } from '@/components/ui/goop/toast';

function InvitePeople() {
  const [invited, setInvited] = useState<string[]>([]);
  return (
    <InviteDialog
      trigger={
        <Button>
          <ButtonIcon icon="plus" />
          <ButtonLabel>Invite</ButtonLabel>
        </Button>
      }
      heading="Invite to Fieldwork"
      description="They get an email with a link to join the workspace."
      roles={[
        { value: 'admin', label: 'Admin', description: 'Can invite people and change their roles' },
        { value: 'member', label: 'Member', description: 'Can see and change every study' },
        { value: 'guest', label: 'Guest', description: 'Can see only the studies shared with them' },
      ]}
      defaultRole="member"
      inviteLink={
        <CopyButton value="https://fieldwork.example/join/7f3a9c" label="Copy invite link" variant="outline" size="md" />
      }
      onSend={async (values) => {
        // your send; throw to keep the dialog open, the message shown in it
        const taken = values.emails.filter((email) => invited.includes(email));
        if (taken.length > 0) throw new Error(`${taken.join(', ')} invited already.`);
        setInvited((now) => [...values.emails, ...now]);
        toast({ title: `${values.emails.length} invites sent` });
      }}
    />
  );
}
  • Fits: frame: sidebar-foot; settings: overlay.
  • Also known as: InviteModal, InviteMembersDialog, InviteForm, ShareDialog.
  • height, width, padding, gap, corner, border: add no class for these.

API reference

  • Each option with its sentence: invite-dialog--options.md
  • Takes every prop of DialogContent but children, title, variant, size, onOpenAutoFocus and defaultValue (its page: dialog.md)
  • State: open (open / defaultOpen / onOpenChange); emails (emails / defaultEmails / onEmailsChange)
  • data-slot values (to select a part by): invite-dialog, invite-dialog-action, invite-dialog-cancel, invite-dialog-error, invite-dialog-group, invite-dialog-header-action, invite-dialog-link, invite-dialog-trigger

InviteDialog: every option

TSX
import { InviteDialog } from '@/components/goop/patterns/invite-dialog';

Options

  • open?: boolean — Open, held by the caller; pair with onOpenChange.
  • defaultOpen?: boolean = false — Open at first, when the dialog holds its own open state.
  • onOpenChange?: (open: boolean) => void — Called as it opens and closes.
  • modal?: boolean = true — The page held behind it while open; false for a picture held open beside the page.
  • trigger?: ReactNode — The control that opens it (the theme's Button), wrapped as the dialog's trigger.
  • heading?: ReactNode = 'Invite people' — The dialog's name, in its header.
  • description?: ReactNode — One line under the header saying what happens next.
  • emails?: readonly string[] — The addresses, held by the caller; pair with onEmailsChange.
  • defaultEmails?: readonly string[] — The addresses at first, when the dialog holds them.
  • onEmailsChange?: (emails: string[]) => void — Called with the addresses each time one is added or removed.
  • roles?: readonly InviteDialogRole[] = [] — The roles a person may join as; none leaves the role's field out.
  • defaultRole?: string — The role chosen as it opens and after each send; the first of roles by default.
  • defaultMessage?: string = '' — The note as it opens and after each send; empty when left out.
  • isEmail?: (text: string) => boolean — Whether typed words are an email address; a plain name@place.tld check by default.
  • invalidEmailsError?: (texts: readonly string[]) => string — The line naming the typed words that are no address.
  • onSend?: (values: InviteDialogValues) => unknown — Sends the invites: a promise the dialog waits on; throw or reject to keep it open with the error.
  • sendLabel?: (count: number) => string — The main button's words, by the count ("Send 3 invites" by default).
  • inviteLink?: ReactNode — The footer's start: the theme's CopyButton with the invite link.
  • emailsLabel?: string = 'Email addresses' — The addresses field's label.
  • emailsPlaceholder?: string = 'name@example.com, name@example.org' — The addresses field's placeholder.
  • roleLabel?: string = 'Role' — The role field's label; "Role" when left out.
  • messageLabel?: string = 'Message' — The note's label; "Message" when left out.
  • messagePlaceholder?: string | null = 'Add a note to the invite (optional)' — The note's placeholder; null leaves the note out.
  • container?: HTMLElement | null — Where the layer and the role's list are portalled; the end of <body> when left out.
  • Takes every prop of DialogContent but children, title, variant, size, onOpenAutoFocus and defaultValue (its page: dialog.md)
  • State: open (open / defaultOpen / onOpenChange); emails (emails / defaultEmails / onEmailsChange)
  • Types: InviteDialogRole = { value: string; label: string; description?: string }; InviteDialogValues = { emails: readonly string[]; role: string; message: string }

Keyboard

KeyWhat it does
EscapeClose, keeping what was typed for the next opening
EnterIn the addresses, make the typed address a tag
BackspaceIn the empty addresses field, select the last tag; again, remove it
Meta+EnterSend
Control+EnterSend
TabMove to the next field or button

Accessibility

  • The part itself answers the keys above.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/invite-dialog.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-invite-dialog.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.