Skip to content
fayeuiStatic / 0.1.0
LLMs
API / Static edition

@fayegram-ai/faye-ui/overlays/dialog

Public exports and dependency-resolved component properties, with usage and rendering guidance.

Import

import { Dialog } from '@fayegram-ai/faye-ui/overlays/dialog';

Usage and behavior guide · API JSON

This entry declares a client boundary. Follow the rendering guide for framework integration.

Public exports

NameKindResolved declaration type
Dialogvalue{ readonly Root: <Payload>(props: Base.Root.Props<Payload>) => React.JSX.Element; readonly createHandle: typeof Base.createHandle; readonly Trigger: { (input: import("@base-ui/react").DialogTriggerProps<unknown> & import("react").RefAttributes<HTMLElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefined; }): import("react").ReactElement; displayName: string; }; readonly Backdrop: { (input: Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visua… (full type in API JSON)

Dialog

Public component; use the linked family guide for complete composition and behavior.

Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.

Dialog.Root

PropertyRequiredTypeMeaning
actionsRefNoRefObject<DialogRootActions | null> | undefinedA ref to imperative actions. - unmount: Manually unmounts the dialog. Call this after any externally controlled closing animation finishes. - close: Closes the dialog imperatively when called.
childrenNoReactNode | PayloadChildRenderFunction<Payload>The content of the dialog. This can be a regular React node or a render function that receives the payload of the active trigger.
defaultOpenNoboolean | undefinedWhether the dialog is initially open. To render a controlled dialog, use the open prop instead.
defaultTriggerIdNostring | null | undefinedID of the trigger that the dialog is associated with. This is useful in conjunction with the defaultOpen prop to create an initially open dialog.
disablePointerDismissalNoboolean | undefinedWhether to prevent the dialog from closing on outside presses. For non-modal dialogs, this also prevents the dialog from closing when focus moves outside of it.
handleNoBase.Handle<Payload> | undefinedA handle to associate the dialog with a trigger. If specified, allows external triggers to control the dialog's open state. Can be created with the Dialog.createHandle() method.
modalNoboolean | "trap-focus" | undefinedDetermines if the dialog enters a modal state when open. - true: user interaction is limited to just the dialog: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled. - false: user interaction with the rest of the document is allowed. - 'trap-focus': focus is trapped inside the dialog, but document page scroll is not locked and pointer interactions outside of it remain enabled. When modal is true or 'trap-focus', render <Dialog.Close> inside <Dialog.Popup> so touch screen readers can escape the popup.
onOpenChangeNo((open: boolean, eventDetails: Base.Root.ChangeEventDetails) => void) | undefinedEvent handler called when the dialog is opened or closed.
onOpenChangeCompleteNo((open: boolean) => void) | undefinedEvent handler called after any animations complete when the dialog is opened or closed.
openNoboolean | undefinedWhether the dialog is currently open.
triggerIdNostring | null | undefinedID of the trigger that the dialog is associated with. This is useful in conjunction with the open prop to create a controlled dialog. There's no need to specify this prop when the dialog is uncontrolled (that is, when the open prop is not set).

Dialog.Trigger

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogTriggerState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
handleNoBase.Handle<unknown> | undefinedA handle to associate the trigger with a dialog. Can be created with the Dialog.createHandle() method.
idNostring | undefinedID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot triggerId prop).
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
payloadNounknownA payload to pass to the dialog when it is opened.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogTriggerState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogTriggerState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Backdrop

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogBackdropState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
forceRenderNoboolean | undefinedWhether the backdrop is forced to render even when nested.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogBackdropState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogBackdropState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Popup

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogPopupState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
finalFocusNoboolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefinedDetermines the element to focus when the dialog is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing.
initialFocusNoboolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void) | undefinedDetermines the element to focus when the dialog is opened. By default, focus moves to the first tabbable element inside the popup, except when the dialog is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard. - false: Do not move focus. - true: Move focus based on the default behavior (first tabbable element or popup). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPopupState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogPopupState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Title

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogTitleState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogTitleState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogTitleState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Description

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogDescriptionState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogDescriptionState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogDescriptionState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Close

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogCloseState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
nativeButtonNoboolean | undefinedWhether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogCloseState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogCloseState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Viewport

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogViewportState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogViewportState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogViewportState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Header

PropertyRequiredTypeMeaning
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Body

PropertyRequiredTypeMeaning
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Actions

PropertyRequiredTypeMeaning
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Dialog.Portal

PropertyRequiredTypeMeaning
classNameNostring | ((state: DialogPortalState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
containerNoHTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null | undefinedA parent element to render the portal element into.
keepMountedNoboolean | undefinedWhether to keep the portal mounted in the DOM while the popup is hidden.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPortalState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: DialogPortalState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.

Defaults and customization

Descriptor defaults: {"size":"md","tone":"neutral"}. Parts: trigger, backdrop, popup, title, description, close, viewport, header, body, actions. Explicit instance props take precedence over configured defaults.

Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.

State, events and accessibility

For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.

Declaration authority

Generated from packages/faye-ui/dist/overlays/dialog.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.