Dialog

A modal window for focused tasks that require the user’s attention.
Stable
Web
iOS
Android
@advui/core
Source

Edit form

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Button, Dialog } from '@advui/core'

<Dialog>
  <Dialog.Trigger asChild>
    <Button>Edit profile</Button>
  </Dialog.Trigger>
  <Dialog.Content>
    <Dialog.Header>
      <Dialog.Title>Edit profile</Dialog.Title>
      <Dialog.Description>Changes are saved to your account.</Dialog.Description>
    </Dialog.Header>
    …
    <Dialog.Footer>
      <Dialog.Close asChild>
        <Button variant="outline">Cancel</Button>
      </Dialog.Close>
      <Button>Save</Button>
    </Dialog.Footer>
  </Dialog.Content>
</Dialog>

Examples

Controlled confirmation

API reference

Dialog

PropTypeDefaultDescription
openboolean—Open state, when you control it.
defaultOpenbooleanfalseOpen at first, when the dialog manages its state.
onOpenChange(open: boolean) => void—Called when opened or closed.

Dialog.Trigger

Opens the dialog. Use `asChild` to render your Button.

Dialog.Content

PropTypeDefaultDescription
size'sm' | 'md' | 'lg' | 'xl''md'Max width.
hideCloseButtonbooleanfalseHide the × button.

Dialog.Header

Stacks the title and description at the top.

Dialog.Footer

A row of actions at the bottom.

Dialog.Title

Names the dialog for screen readers.

Dialog.Description

Describes the dialog; read with the title.

Dialog.Close

Closes the dialog. Use `asChild` to render your Button.
PropTypeDefaultDescription
asChildboolean—Wrap your own Button.

Accessibility

  • role="dialog" + aria-modal, labelled by Dialog.Title and described by Dialog.Description.
  • Focus moves into the dialog on open, is trapped while open, and returns to the trigger on close.
  • Escape and the overlay close the dialog; the × button has the label “Close”.
  • Dialog.Close keeps its child’s visible text as the accessible name.
Keyboard interactions
KeyAction
Tab / Shift+TabCycles focus inside the dialog.
EscapeCloses the dialog.

Responsive behavior

Width is 92% of the viewport up to the size cap, and footer buttons stack vertically below sm.

Platform notes

Web
Rendered in a portal with the page scroll locked.
iOS
Rendered in a native portal above navigation. Consider a Sheet for long forms.
Android
The hardware back button closes the dialog.
Since v0.1.0Last updated Nov 2, 2026Edit this page on GitHub