Skip to main content

Examples

Default

Large (600px)

With Header Description

Simple Default

With Trigger

Props

Dialog

Root component that manages open/close state for a dialog. A direct re-export of the Radix DialogPrimitive.Root primitive. It accepts all of that primitive’s props, unchanged.

DialogBody

Scrollable content area (slot) between the header and footer. Grows to fill available space and scrolls when content overflows. Unless className sets horizontal padding, its clip edge sits 4px outside the content so rings on edge controls show. Takes no props of its own. Accepts all standard div attributes, including className.

DialogClose

Convenience alias for Radix Dialog.Close. Closes the dialog when clicked. A direct re-export of the Radix DialogPrimitive.Close primitive. It accepts all of that primitive’s props, unchanged.

DialogContent

The dialog panel. Includes the overlay by default and portals to document.body by default. Set portal={false} to keep overlay and content in the DOM subtree of the parent Dialog. fixed positioning still applies; ancestors with transform or overflow may affect layout. On mobile viewports (<640px), the dialog slides up from the bottom as a sheet with top-only border radius by default; pass mobilePresentation="card" to render a floating card anchored near the bottom instead (used for small confirmation dialogs). On larger viewports it renders centered with full border radius. size="full" skips both and fills the viewport with no chrome. Give a multi-step dialog a step to animate between its views (see MorphPanel). The panel carries its size as data-size, for styling its children. It animates in and out. While the closing animation plays the panel stays mounted but ignores pointer input, so a second click can’t act on it.
boolean
"sheet" | "card"
default:"sheet"
How the dialog presents below the sm breakpoint.
  • "sheet" — bottom sheet pinned to the viewport bottom edge (default)
  • "card" — floating card per the v2-modal spec: 8px from the sides and the bottom (plus the safe-area inset), 16px padding, 32px radius on all corners, no pull handle
boolean
default:"true"
When true, renders overlay automatically.
DialogOverlayProps
Props forwarded to the default DialogOverlay when overlay is true.
boolean
default:"true"
When true, teleports overlay and panel to document.body. When false, renders inline in the React tree (useful inside theme providers or scoped containers).
boolean
default:"true"
Show the v2 mobile sheet pull handle. Only rendered when mobilePresentation is "sheet".
"md" | "sm" | "lg" | "full"
default:"md"
Size preset for the dialog.
  • "sm" — 400px max-width (confirmations, simple forms)
  • "md" — 440px max-width (default, standard dialogs)
  • "lg" — 600px max-width (complex content, tables)
  • "full" — edge to edge with no border, radius, padding or pull handle, on the theme’s bg-background-primary surface, for media viewers. A viewer that wants a black stage passes its own surface through className. Its height follows --visual-viewport-h when the page sets it (to track the on-screen keyboard) and falls back to 100dvh.
number
Which view of a multi-step dialog is showing, in navigation order: a higher step is deeper. When set, the children sit in a MorphPanel, so changing it morphs the dialog to the new view’s height and slides the view in from the right going deeper or from the left going back. Children keep their state across steps, and focus moves to the new view’s heading. Leave it unset for a dialog with one view.Keep it a number for as long as the dialog is open: switching between a number and undefined adds or removes the panel and remounts the children. Reset it after the close animation rather than in onOpenChange(false), or the dialog plays a step transition as it closes.

DialogDescription

Accessible description for the dialog. Rendered as secondary text.
boolean

DialogFooter

Footer bar for the dialog. Typically contains action buttons. Children are laid out in a horizontal row with equal flex-basis. Takes no props of its own. Accepts all standard div attributes, including className.

DialogHeader

Header bar for the dialog. Renders the title with an optional back arrow and close button. In a dialog with a step, it holds still while the body moves between steps (see MorphPanel).
string
default:"Go back"
Accessible label for the back button.
string
default:"Close"
Accessible label for the close button.
ReactNode
Description rendered full width below the title, under the back and close buttons. Use it instead of a DialogDescription child, not with one: a dialog takes one description. It wraps inside the header element, so className, ref and other props cover it too. With graphic, it renders centred below the title instead.
ReactNode
Illustration shown centred in an 80px slot above the title. When set, the header centres the title and description, and the back and close buttons sit in a row above the illustration. Use it for dialogs led by an illustration; leave it unset when the body is the visual, such as a list or a QR code. Hide a decorative graphic from screen readers (aria-hidden or alt=""); give a meaningful one a name. In a dialog with a step, a header with a graphic moves with the body between steps rather than holding still.
(() => void)
Called when the back button is clicked.
boolean
Show a back arrow button on the left side. Defaults to true when onBack is provided.
boolean
default:"true"
Show the close (X) button in the header.

DialogOverlay

Semi-transparent backdrop rendered behind the dialog content. Rendered by DialogContent; portaled to document.body when DialogContent portal is true.
boolean

DialogTitle

Accessible title for the dialog. Must be rendered inside DialogHeader or directly within DialogContent.
boolean

DialogTrigger

The element that opens the dialog when clicked. On touch / pen, a press-and-release that crosses a small movement threshold is treated as a drag and the resulting synthetic click is suppressed — defends against Android Chrome opening the dialog on a scroll-drag-end.
boolean

Exported types

Also exported from @fanvue/ui: DialogBodyProps, DialogCloseProps, DialogContentProps, DialogContentSize, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogOverlayProps, DialogProps, DialogTitleProps, DialogTriggerProps.
Setup: Installation · Theming