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">
| Prop | Type | Default | Description |
|---|---|---|---|
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 | boolean | false | Uncontrolled 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. |