Skip to content
HomeCobalt

Invite field

Collects the email addresses of people to invite and the role they will get, then sends the invitations in one request and says how it went.

Examples

Invites people to a shared watchlist. Type or paste addresses, and each becomes a chip; one that is not an address, or already has access, stays red with the reason under the field, and Invite waits for it. The role's options say what each allows.

Separate addresses with commas or spaces

FailedWhen the invitations are not sent, Invite says so in place, the addresses stay, and the line under the field says what to do. Press Invite again; the second try goes through.
lee.chen@example.comsofia.martin@example.com

Separate addresses with commas or spaces

In a cardA team page's invite card: invite by email with a role, and the line under the field says what each step needs.
Invite your team
Each person gets an email with a link that works for seven days.

Separate addresses with commas or spaces

Usage

Use it when

  • People are invited by email to something shared, such as a watchlist, a workspace or a team, with a role each.
  • A list of addresses is pasted from a mail app or a spreadsheet and sent in one request.

Use something else when

  • People are picked from a directory the app already holds, such as teammates by name. Use Combobox instead, with multiple.
  • One address for an account, such as a contact field. Use Input instead, with type="email" inside a Field.
  • Access is given by a link anyone with it can open. Use ShareLink instead, on the MemberList page.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/invite-field.json https://kaanarici.com/r/cobalt/emails.json
import { InviteField, inviteFieldLabels, type MemberRole } from "@/components/cobalt/ui/invite-field"
import { addAddresses, isEmail, readAddresses, sameAddress } from "@/lib/cobalt/emails"