Skip to main content
  1. Docs
  2. Components
  3. Overlays

Dialog

A focused decision or a short task, over the page. Danger and warning ask before something happens.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div role="dialog">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Playground

Every prop, live, and the code it takes.

Intent
Size
revoke.tsx
import { Button, Dialog, DialogClose, DialogContent, DialogFooter, DialogTrigger } from "@qeetrix/react";

<Dialog intent="danger">
  <DialogTrigger render={<Button>Open</Button>} />
  <DialogContent
    title="Revoke this API key?"
    description="The reconciler stops working at once."
    size="sm"
  >
    <DialogFooter>
      <DialogClose render={<Button variant="ghost">Cancel</Button>} />
      <DialogClose render={<Button tone="danger">Confirm</Button>} />
    </DialogFooter>
  </DialogContent>
</Dialog>

02

A task

A trigger, a title, a body and the actions. Focus lands on the first field; Escape and an outside click close it.

03

Warning and danger

intent: an alert dialog with an amber or red line. A danger dialog closes only by its actions.

04

Sizes

sm 400, md 560, lg 800 and xl 1120px, never wider than the window less 48px; fullscreen for a whole-screen task.

05

A long body

DialogBody scrolls between a fixed header and footer; with nothing to focus in it, it takes focus to scroll by keys.

06

Controlled

open and onOpenChange: open it from code, close it once the action is done.

Nothing deleted yet.

07

In Hindi

The close button's name comes from QeetrixProvider.

Next — DialogUsage