Skip to content
Overlays & Tooltips

Invite Dialog

Ergonomic Dialog for inviting a member by email and role.

Import

tsx
import { InviteDialog } from "@cronus-ui/ui";
bash
npx cronus-ui add invite-dialog

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component InviteDialogDefault layout:inline style:invite-dialog {
  label "Invite member"
}

page "/audit/invite-dialog/default" type:custom {
  use InviteDialogDefault
}

API Reference

Generated from the component's exported types.

InviteDialogLabels

Skip InviteDialogLabels props table
PropTypeDefaultDescription
title
string——
description
string——
email
string——
emailPlaceholder
string——
role
string——
send
string——
cancel
string——
sending
string——
errorFallback
string——
sentTitle
string——
sentDescription
string——
link
string——
copy
string——
copied
string——
done
string——

InviteDialogProps

Extends Omit<ComponentPropsWithoutRef<typeof DialogContent>, "title" | "children" | "labels">

Skip InviteDialogProps props table
PropTypeDefaultDescription
trigger
ReactNode—Element that opens the dialog. Rendered inside a `DialogTrigger asChild`. Omit when driving the dialog purely via `open`.
open
boolean—Controlled open state. Provide alongside `onOpenChange` to control the dialog externally.
defaultOpen
booleanfalseUncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called whenever the open state changes. Dismissal is suppressed while an invite promise is pending.
roles
readonly InviteRole[]—Roles offered in the select. Defaults to Member and Admin.
defaultRole
string—Initially selected role `value`. Falls back to the first role.
onInvite
(payload: { email: string; role: string }) => InviteHandlerReturn—Invoked with the submitted email and role. If it returns a promise, the send button shows a spinner and actions are disabled until it settles. On reject the dialog stays open and surfaces the error. On resolve: a `{ url }` keeps the dialog open with a copyable link; otherwise the dialog closes.
labels
InviteDialogLabels—Override any subset of the built-in English strings.
ref
Ref<HTMLDivElement>—Forwarded to the dialog content surface.
asChild
boolean—Render as the child element via Slot.
className
string—Additional class names merged onto the root.