Skip to content

Overlays

Dialog

Bundle size
1 B
3.0.1

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

This component is an expansion of the Dialog developed and maintained by Radix UI.

Unlike a Toast, the Dialog interrupts the user experience, adding a new step to their navigation journey. It can be used to confirm important actions or to present additional information to the current context.

The Dialog can be triggered from 5 different positions. Clicking outside of it will close it.

Terminal window
pnpm add @inpulse-ui/dialog

Contains all parts of a Dialog.

PropTypeDefault ValueRequired
defaultOpenboolean-No
openboolean-No
onOpenChangefunction-No

Responsible for opening the Dialog.

PropTypeDefault ValueRequired
asChildboolean-No
AttributeValue
[data-state]"open" | "closed"

Abraça todo o conteúdo exibido pelo Dialog.

PropTypeDefault ValueRequired
asChildboolean-No
onOpenAutoFocusfunction-No
onCloseAutoFocusfunction-No
onEscapeKeyDownfunction-No
onPointerDownOutsidefunction-No
onInteractOutsidefunction-No
positionstringcenterNo
AttributeValue
[data-state]"open" | "closed"

Responsible for closing the Dialog.

PropTypeDefault ValueRequired
asChildboolean-No

A title that is announced in an accessible way when a Dialog is opened. If you want to hide the title, wrap it with a <VisuallyHidden asChild>.

PropTypeDefault ValueRequired
asChildboolean-No

A description that is announced in an accessible way when a Dialog is opened.

PropTypeDefault ValueRequired
asChildboolean-No

Wrap all subcomponents within the Dialog component. The DialogTrigger is the trigger that opens the Dialog, while the DialogContent contains all the content of the Dialog. The DialogHeader is optional and can contain a title and a description.

<Dialog>
<DialogTrigger>
Open
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Title</DialogTitle>
<DialogDescription>
Lorem ipsum
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>

This is the default Dialog position.

You can ask the Dialog to appear from one of the four corners of the screen using the position property that must be applied to the DialogContent subcomponent. Possible values ​​are: top, right, bottom and left.

The Dialog that comes from the sides will automatically enable scrolling if the content exceeds the height of the device. Note that Dialog with position value center, top or bottom is not intended to have long extensions of content and therefore does not have scroll by default.

Use props to close the Dialog programmatically. For example, after completing an asynchronous action.

Project

Built with by Jo Santana in Brazil.

© 2026 Inpulse. All rights reserved.