@fayegram-ai/faye-ui/overlays/drawer
Public exports and dependency-resolved component properties, with usage and rendering guidance.
Import
import { Drawer } from '@fayegram-ai/faye-ui/overlays/drawer';Usage and behavior guide · API JSON
This entry declares a client boundary. Follow the rendering guide for framework integration.
Public exports
| Name | Kind | Resolved declaration type |
|---|---|---|
DrawerPopupProps | type | DrawerPopupProps |
Drawer | value | Omit<{ readonly Root: <Payload>(props: DialogRoot.Props<Payload>) => React.JSX.Element; readonly createHandle: typeof createDialogHandle; readonly Trigger: { (input: DialogTriggerProps<unknown> & RefAttributes<HTMLElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefined; }): ReactElement<unknown, string | JSXElementConstructor<any>>; displayName: string; }; readonly Backdrop: { (input: Omit<DialogBackdropProps, "ref"> & RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"dialog", "size"> | … (full type in API JSON) |
Drawer
Modal sheet composition. Does not claim swipe/gesture 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.
Drawer.Root
| Property | Required | Type | Meaning |
|---|---|---|---|
actionsRef | No | RefObject<DialogRootActions | null> | undefined | A 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. |
children | No | ReactNode | 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. |
defaultOpen | No | boolean | undefined | Whether the dialog is initially open. To render a controlled dialog, use the open prop instead. |
defaultTriggerId | No | string | null | undefined | ID of the trigger that the dialog is associated with. This is useful in conjunction with the defaultOpen prop to create an initially open dialog. |
disablePointerDismissal | No | boolean | undefined | Whether 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. |
handle | No | Base.Handle<Payload> | undefined | A 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. |
modal | No | boolean | "trap-focus" | undefined | Determines 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. |
onOpenChange | No | ((open: boolean, eventDetails: Base.Root.ChangeEventDetails) => void) | undefined | Event handler called when the dialog is opened or closed. |
onOpenChangeComplete | No | ((open: boolean) => void) | undefined | Event handler called after any animations complete when the dialog is opened or closed. |
open | No | boolean | undefined | Whether the dialog is currently open. |
triggerId | No | string | null | undefined | ID 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). |
Drawer.Trigger
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogTriggerState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
handle | No | Base.Handle<unknown> | undefined | A handle to associate the trigger with a dialog. Can be created with the Dialog.createHandle() method. |
id | No | string | undefined | ID 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). |
nativeButton | No | boolean | undefined | Whether 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>). |
payload | No | unknown | A payload to pass to the dialog when it is opened. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogTriggerState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogTriggerState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Backdrop
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogBackdropState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
forceRender | No | boolean | undefined | Whether the backdrop is forced to render even when nested. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogBackdropState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogBackdropState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Viewport
Example disposition: Optional viewport composition for application-specific long content. The Dialog.Viewport live example exercises the scrollable layout; this short confirmation/drawer uses its existing direct popup composition.
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogViewportState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogViewportState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogViewportState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Portal
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogPortalState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
container | No | HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null | undefined | A parent element to render the portal element into. |
keepMounted | No | boolean | undefined | Whether to keep the portal mounted in the DOM while the popup is hidden. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPortalState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogPortalState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
Drawer.Title
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogTitleState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogTitleState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogTitleState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Description
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogDescriptionState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogDescriptionState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogDescriptionState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Close
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogCloseState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
nativeButton | No | boolean | undefined | Whether 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>). |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogCloseState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogCloseState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Header
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Body
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Actions
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | { 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 | See the usage contract and declaration. |
Drawer.Popup
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DialogPopupState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
edge | No | "start" | "end" | "top" | "bottom" | undefined | See the usage contract and declaration. |
finalFocus | No | boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefined | Determines 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. |
initialFocus | No | boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void) | undefined | Determines 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. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPopupState> | undefined | Allows 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. |
style | No | CSSProperties | ((state: DialogPopupState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"dialog", "size"> | undefined; readonly tone?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"dialog", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Defaults and customization
Defaults and native behavior are documented in the linked family guide. This reference does not infer a default from an optional property.
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/drawer.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.