Dialog

Displays a modal window above the page contents.

Dialog.Body

indicators

nonexyleftrighttopbottomall

Also supports MarginProps: `m`, `mb`, `ml`, `mr`, `mt`, `mx`, `my`

Dialog.Content

align

centerstart

asChild

boolean

Composes the component into its immediate child instead of rendering its own HTML element. You’ll have to provide a single React Element child.

container

Element | DocumentFragment | null

height

Responsive<string>

maxHeight

Responsive<string>

maxWidth

Responsive<string>

Sets the CSS **max-width** property. Supports CSS strings and responsive objects.

minHeight

Responsive<string>

minWidth

Responsive<string>

Sets the CSS **min-width** property. Supports CSS strings and responsive objects.

size

123456
Default: 3

width

Responsive<string>

Sets the CSS **width** property. Supports CSS strings and responsive objects.

Dialog.Description

align

centerleftright

color

rubygraygoldbronzebrownyellowamberorangetomatoredcrimsonpinkplumpurplevioletirisindigobluecyantealjadegreengrasslimemintsky

highContrast

boolean

size

123456789

trim

endnormalbothstart

truncate

boolean

weight

boldmediumlightregular

wrap

wrapnowrapprettybalance

Also supports MarginProps: `m`, `mb`, `ml`, `mr`, `mt`, `mx`, `my`

Dialog.Header

title

required
ReactNode

description

ReactNode

error

ReactNode

Also supports MarginProps: `m`, `mb`, `ml`, `mr`, `mt`, `mx`, `my`

Dialog.Title

align

centerleftright

as

h1h2h3h4h5h6

color

rubygraygoldbronzebrownyellowamberorangetomatoredcrimsonpinkplumpurplevioletirisindigobluecyantealjadegreengrasslimemintsky

highContrast

boolean

size

123456789

trim

endnormalbothstart

truncate

boolean

weight

boldmediumlightregular

wrap

wrapnowrapprettybalance

Also supports MarginProps: `m`, `mb`, `ml`, `mr`, `mt`, `mx`, `my`

Use the size prop in the Content component to control the maxWidth of the dialog. If you have a very specific case, you can still pass a custom maxWidth prop to override the size.

Use the Inset component to create a container that ignores the Content part padding. If needed, you can recreate the original padding by setting the Inset part’s padding props to "current".

Whenever the body of the dialog is bigger than the dialog itself, it will show a scrollbar automatically.

This is now deprecated. You should combine the Header, Body and Footer parts to create a scrollable content. So this example is only for reference as most of our dialogs in the dashboard still use this type of dialog.

There are a couple ways to use tables inside dialogs.

  1. You can use the Inset component without Table.Root for an edge-to-edge design
  2. Use with the Table.Root for a contained table look.

Dialogs commonly contain forms for creating or editing resources. These patterns demonstrate proper state management for loading, dirty checking, and error handling using React Hook Form.

Demonstrates how to display form submit errors within dialogs.

The loading state should always be true when the form is submitted or when the submission has succeeded AND the dialog has been closed

For edit forms only, keep the submit button disabled when the form is not dirty:

Form reset on dialog open

Place the <form> tag inside Dialog.Body and use the form attribute on submit buttons. Display form-level errors using the Dialog.Header error prop:

This approach:

  • Preserves the dialog’s flex layout structure
  • Displays errors prominently in the header

Use your resolver (like Zod) for field validation, and display errors inline.

For simple forms (using register):

For edit forms or when you need more control (using Controller):

A complete example showing how to create a dialog for adding new resources with proper form reset and loading states.

For editing existing resources, the submit button should be disabled when the form is not dirty (no changes made).

Dashboard

12 variants found

Dialog in Reset Organization Custom Attribute Mappingdashboard
Dialog in Connection Metadata Xmldashboard
size 2 dialog in Managed List Dialogdashboard
size=2
size 2 dialog in Edit Vault Object Dialogdashboard
size=2
size 5 dialog in Edit Directory Custom Attribute Mappings Dialogdashboard
size=5
size 5 dialog in Onboard Impersonation Dialogdashboard
size=5
size 2 dialog in Onboard Impersonation Dialogdashboard
color=graysize=2
size 3 dialog in Slack Integration Dialogdashboard
size=3
size 3 dialog in Add Billing Info Modaldashboard
size=3
size 1 dialog in Upgrade Account Dialogdashboard
size=1
size 1 dialog in Audit Log Delete Event Dialogdashboardstatic
<Dialog.Root open={open} onOpenChange={handleOpenChange}> <Dialog.Content size="1"> <AuditLogDeleteEventDialogContent event={event} onFormSubmitSuccess={async () => { await Promise.all([onDelete?.(), waitMilliseconds(500)]); void handleOpenChange(false); }} /> </Dialog.Content> </Dialog.Root>
size=1
size 4 dialog in Update Provider Dialogdashboard
size=4

Context

Dialog.Body
PropTypeDefaultRequired
indicators
"none" | "x" | "y" | "left" | "right" | "top" | "bottom" | "all"no

Also supports MarginProps: m, mb, ml, mr, mt, mx, my

Dialog.Content
PropTypeDefaultRequired
align
"center" | "start"no
asChild
booleanno
container
Element | DocumentFragment | nullno
height
Responsive<string>no
maxHeight
Responsive<string>no
maxWidth
Responsive<string>no
minHeight
Responsive<string>no
minWidth
Responsive<string>no
size
"1" | "2" | "3" | "4" | "5" | "6"3no
width
Responsive<string>no
Dialog.Description
PropTypeDefaultRequired
align
Responsive<"center" | "left" | "right">no
color
"ruby" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | ... 8 more ...no
highContrast
booleanno
size
Responsive<"1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">no
trim
Responsive<"end" | "normal" | "both" | "start">no
truncate
booleanno
weight
Responsive<"bold" | "medium" | "light" | "regular">no
wrap
Responsive<"wrap" | "nowrap" | "pretty" | "balance">no

Also supports MarginProps: m, mb, ml, mr, mt, mx, my

Dialog.Header
PropTypeDefaultRequired
title
ReactNodeyes
description
ReactNodeno
error
ReactNodeno

Also supports MarginProps: m, mb, ml, mr, mt, mx, my

Dialog.Title
PropTypeDefaultRequired
align
Responsive<"center" | "left" | "right">no
as
"h1" | "h2" | "h3" | "h4" | "h5" | "h6"no
color
"ruby" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | ... 8 more ...no
highContrast
booleanno
size
Responsive<"1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">no
trim
Responsive<"end" | "normal" | "both" | "start">no
truncate
booleanno
weight
Responsive<"bold" | "medium" | "light" | "regular">no
wrap
Responsive<"wrap" | "nowrap" | "pretty" | "balance">no

Also supports MarginProps: m, mb, ml, mr, mt, mx, my

Usage

Used 563 times across 2 packages

Dashboard
475
Admin Portal
88

Variant Distribution

size

1
14%
2
54%
3
18%
4
4%
5
11%

color

gray
100%

trim

both
100%

align

start
100%

Where it's used

109 files

packages/dashboard/src/components/connections/certificate-expiry-callout.tsx14
packages/dashboard/src/components/configuration/stripe-entitlements/dialogs/connected-dialog.tsx9
packages/dashboard/src/components/pipes/add-provider-dialog.tsx9
packages/dashboard/src/components/flags/slack-integration-dialog.tsx8
packages/dashboard/src/components/roles/edit-user-role-dialog.tsx8
packages/dashboard/src/legacy-pages/[environmentId]/organizations/[organizationId]/domains/add-domains-dialog/add-domains-dialog.tsx8
packages/dashboard/src/components/branding/logo-icon-fit-dialog.tsx7

/domains

packages/dashboard/src/app/(private)/(sidebar)/domains/verify-custom-email-domain-dialog-content.tsx8

/branding/edit

packages/dashboard/src/app/(private)/(chromeless)/branding/edit/edit-branding.tsx7

/:environmentId/applications/:applicationId

packages/dashboard/src/app/(private)/(sidebar)/[environmentId]/applications/[applicationId]/edit-application-dialog.tsx7

Show 99 more files