Dialog
A native modal dialog with focus return and animated presentation.
Installation
Import from the Reflow workspace package.
Basic
Open demoimport { Dialog, Input } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Dialog title="Edit profile" trigger="Open dialog">
<Input aria-label="Display name" />
</Dialog>
</>
)
}Sizes
import { Dialog } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Dialog size="sm" title="Small dialog" trigger="Small" />
<Dialog size="lg" title="Large dialog" trigger="Large" />
<Dialog size="xl" title="Extra large dialog" trigger="Extra large" />
</>
)
}API Reference
Public props for the Reflow implementation. Native controls also accept their standard HTML attributes and Remix event mixes.
Dialog
| Prop | Type | Default | Description |
|---|---|---|---|
triggerVariant | ButtonProps["variant"] | — | Visual treatment of the opening button. |
triggerSize | ButtonProps["size"] | — | Size of the opening button. |
trigger | RemixNode | — | Contents of the button that opens the dialog. |
title* | string | — | Heading displayed by the component. |
description | string | — | Additional explanatory text. |
children | RemixNode | — | Content rendered inside the component. |
footer | RemixNode | ((close: () => void) => RemixNode) | — | Render footer actions with a callback that requests dismissal. |
size | "sm" | "lg" | "xl" | — | Control density or icon-button dimensions. |
position | "center" | "top" | — | Vertical placement in the viewport. |
open | boolean | — | Controlled visibility. |
defaultOpen | boolean | — | Initial visibility. |
onOpenChange | ((open: boolean) => void) | — | Called when visibility changes. |
showCloseButton | boolean | true | Shows the close affordance. |
dismissOnBackdrop | boolean | true | Allows a click on the backdrop to dismiss the dialog. |
modal | boolean | — | Uses modal focus and background interaction behavior. |