Dialog
A focused modal that asks for one decision.
In context
Projects
Wayfinding for the three northern depots. 48% done, due 21 Nov.
Promise confirm()
Nothing asked yet.
Props
| Prop | Type | Required | Default |
|---|---|---|---|
open | boolean | undefined | No | — |
defaultOpen | boolean | undefined | No | — |
onOpenChange | ((open: boolean) => void) | undefined | No | — |
trigger | ReactNode | No | — |
title | ReactNode | Yes | — |
description | ReactNode | No | — |
footer | ReactNode | No | — |
className | string | undefined | No | — |
bionic | boolean | undefined | No | — |
bionicOptions | BionicOptions | undefined | No | — |
activeBorder | boolean | undefined | No | — |
autoDismiss | number | undefined | No | — |
fullscreen | boolean | undefined | No | — |
container | HTMLElement | null | undefined | No | — |
Accessibility
role="dialog" with aria-modal="true" set explicitly (this Radix version does not set it itself). Esc closes it, Tab cycles focus only within the dialog while open, and focus returns to the trigger on close.
data-rebar-* attributes
data-rebar-component="dialog" on the content; data-rebar-part="title" | "description" | "body" | "footer" | "close". Radix's own data-state="open"|"closed" is read directly, not duplicated.
Migrating to Ant Design
@rebar-ui/migrate-antd renames the element to Modal (open, title and footer are already compatible names). onOpenChange becomes onCancel, flagged with a review comment since AntD's onCancel takes no argument. description is promoted into a child paragraph rather than dropped.