Skip to content
Overlays

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

API Reference

Generated from the component's exported types.

InviteDialogProps

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

Skip InviteDialogProps props table
PropTypeDefaultDescription
trigger
ReactNodeElement that opens the dialog. Rendered inside a `DialogTrigger asChild`. Omit when driving the dialog purely via `open`.
open
booleanControlled open state. Provide alongside `onOpenChange` to control the dialog externally.
defaultOpen
booleanfalseUncontrolled initial open state.
onOpenChange
(open: boolean) => voidCalled 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
stringInitially selected role `value`. Falls back to the first role.
onInvite
(payload: { email: string; role: string }) => InviteHandlerReturnInvoked 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
InviteDialogLabelsOverride any subset of the built-in English strings.
ref
Ref<HTMLDivElement>Forwarded to the dialog content surface.