Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Dialog examples · Standard

Invite Team Members Dialog for React

A team invitation dialog with three email fields, a send button and a shareable invite link.

Framework
UI library

Inviting teammates shouldn't need a trip to settings. This React dialog takes up to three email addresses or hands out a link anyone can join with. It's shadcn.io's Dialog on Base UI with Input and Field parts, and a FieldSeparator between the two ways in.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How do I validate the emails?

Validate each field when it loses focus and show a FieldError under the invalid ones. Empty fields are fine; disable Send Invitations until at least one address is valid.

Should invite links expire?

Yes, after a week or so, and let admins regenerate them. Say when the link expires in its FieldDescription.

How do I make Copy work?

Copy the link to the clipboard on click and confirm with a toast or a brief Copied label. The Clipboard component does this with a built-in indicator.

Can I pick a role for each invitee?

Yes: add a Select beside each email, or one default role for the whole batch.

How is the Or share link divider built?

With FieldSeparator, which draws the line and centers its text, inside the FieldGroup.

Are the fields labelled?

Each email field has a visible FieldLabel. The link field's label is sr-only, so screen readers announce Invite link without repeating it on screen.