Dialog
3 widths, spring in and out.
Installation
Install Dialog from the Fluid Effect UI registry.
Basic
Sizes
3 widths: sm for a confirmation, lg for a short form, xl for a layout of its own.
With a sidebar
The extra-wide dialog uses a sidebar on desktop and a section picker on small screens.
API Reference
Types come from the public API. A dash indicates no default is documented here.
Dialog props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "RequestedClose"; readonly reason: "trigger-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "close-watcher"; } | { readonly _tag: "RequestedOpen"; readonly triggerId: string | null; } | { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined) | { readonly RequestedClose: (event: { readonly _tag: "RequestedClose"; readonly reason: "trigger-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "close-watcher"; }) => NoInfer<Msg> | undefined; readonly RequestedOpen: (event: { readonly _tag: "RequestedOpen"; readonly triggerId: string | null; }) => NoInfer<Msg> | undefined; readonly Settled: (event: { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.open | boolean | Required | |
props.id | string | undefined | — | |
props.modal | boolean | "trap-focus" | undefined | true | |
props.topLayer | boolean | undefined | — | |
props.finalFocus | boolean | undefined | — | |
props.holdExit | boolean | undefined | — | |
props.triggerId | string | null | undefined | — | |
props.openMethod | "touch" | "keyboard" | "mouse" | "pen" | null | undefined | — | |
props.keepMounted | boolean | undefined | — | |
props.disablePointerDismissal | boolean | undefined | — | |
props.forceRenderBackdrop | boolean | undefined | — | |
props.nested | boolean | undefined | — | |
props.initialFocus | boolean | undefined | — | |
size | "sm" | "lg" | "xl" | 'sm' | |
density | TypeScaleVariant | — | |
shape | ShapeVariant | 'rounded' | |
surface | number | 1 | |
position | "top" | "center" | 'center' | |
className | string | '' | |
contentClassName | string | — | |
headerClassName | string | — | |
reducedMotion | "user" | "always" | "never" | — | |
title | string | Required | |
description | string | — | |
trigger | View.Input<Msg, R> | — | |
triggerButton | Omit<ButtonProps<Msg, R>, "onPress"> | — | |
content | (parts: DialogParts) => View.Input<Msg, R> | Required | |
footer | (parts: DialogParts) => View.Input<Msg, R> | — | |
showCloseButton | boolean | — |