@fayegram-ai/faye-ui/overlays/swipe-drawer
Public exports and dependency-resolved component properties, with usage and rendering guidance.
Import
import { SwipeDrawer } from '@fayegram-ai/faye-ui/overlays/swipe-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 |
|---|---|---|
SwipeDrawer | value | { readonly Root: typeof Base.Root; readonly Provider: typeof Base.Provider; readonly VirtualKeyboardProvider: typeof Base.VirtualKeyboardProvider; readonly createHandle: typeof Base.createHandle; readonly Portal: typeof Portal; readonly Trigger: { (input: import("@base-ui/react").DrawerTriggerProps<unknown> & import("react").RefAttributes<HTMLElement> & { variants?: {} | undefined; }): import("react").ReactElement; displayName: string; }; readonly SwipeArea: { (input: Omit<import("@base-ui/react").DrawerSwipeAreaProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?: {} | undefined; }): import("react").ReactElement; displayName: string; }; readonly Backdrop: { (input: Omit<import("@base-ui/react").DrawerBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivEleme… (full type in API JSON) |
SwipeDrawer
Gesture/snap-point drawer. Physical swipeDirection and positioning agree; no second gesture or focus engine.
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.
SwipeDrawer.Root
| Property | Required | Type | Meaning |
|---|---|---|---|
actionsRef | No | React.RefObject<DrawerRootActions | null> | undefined | A ref to imperative actions. - unmount: Manually unmounts the drawer. Call this after any externally controlled closing animation finishes. - close: Closes the drawer imperatively when called. |
children | No | React.ReactNode | PayloadChildRenderFunction<Payload> | The content of the drawer. |
defaultOpen | No | boolean | undefined | Whether the drawer is initially open. To render a controlled drawer, use the open prop instead. |
defaultSnapPoint | No | DrawerSnapPoint | null | undefined | The initial snap point value when uncontrolled. |
defaultTriggerId | No | string | null | undefined | ID of the trigger that the drawer is associated with. This is useful in conjunction with the defaultOpen prop to create an initially open drawer. |
disablePointerDismissal | No | boolean | undefined | Whether to prevent the drawer from closing on outside presses. For non-modal drawers, this also prevents the drawer from closing when focus moves outside of it. |
handle | No | DrawerHandle<Payload> | undefined | A handle to associate the drawer with a trigger. If specified, allows detached triggers to control the drawer's open state. Can be created with the Drawer.createHandle() method. |
modal | No | boolean | "trap-focus" | undefined | Determines if the drawer enters a modal state when open. - true: user interaction is limited to just the drawer: 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 drawer, but document page scroll is not locked and pointer interactions outside of it remain enabled. |
onOpenChange | No | ((open: boolean, eventDetails: DrawerRoot.ChangeEventDetails) => void) | undefined | Event handler called when the drawer is opened or closed. |
onOpenChangeComplete | No | ((open: boolean) => void) | undefined | Event handler called after any animations complete when the drawer is opened or closed. |
onSnapPointChange | No | ((snapPoint: DrawerSnapPoint | null, eventDetails: DrawerRoot.SnapPointChangeEventDetails) => void) | undefined | Callback fired when the snap point changes. |
open | No | boolean | undefined | Whether the drawer is currently open. |
snapPoint | No | DrawerSnapPoint | null | undefined | The currently active snap point. Use with onSnapPointChange to control the snap point. |
snapPoints | No | DrawerSnapPoint[] | undefined | Snap points used to position the drawer. Use numbers between 0 and 1 to represent fractions of the viewport height, numbers greater than 1 as pixel values, or strings in px/rem units (for example, '148px' or '30rem'). |
snapToSequentialPoints | No | boolean | undefined | Disables velocity-based snap skipping so drag distance determines the next snap point. |
swipeDirection | No | SwipeDirection | undefined | The swipe direction used to dismiss the drawer. |
triggerId | No | string | null | undefined | ID of the trigger that the drawer is associated with. This is useful in conjunction with the open prop to create a controlled drawer. There's no need to specify this prop when the drawer is uncontrolled (that is, when the open prop is not set). |
SwipeDrawer.Provider
| Property | Required | Type | Meaning |
|---|---|---|---|
children | No | React.ReactNode | See the usage contract and declaration. |
SwipeDrawer.VirtualKeyboardProvider
| Property | Required | Type | Meaning |
|---|---|---|---|
children | No | React.ReactNode | See the usage contract and declaration. |
SwipeDrawer.Portal
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerPortalState) => 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, DrawerPortalState> | 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: DrawerPortalState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
SwipeDrawer.Trigger
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerTriggerState) => 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 drawer. Can be created with the Drawer.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 drawers in controlled mode (with the Drawer.Root 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 drawer when it is opened. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DrawerTriggerState> | 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: DrawerTriggerState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.SwipeArea
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerSwipeAreaState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
disabled | No | boolean | undefined | Whether the swipe area is disabled. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DrawerSwipeAreaState> | 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: DrawerSwipeAreaState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
swipeDirection | No | SwipeDirection | undefined | The swipe direction that opens the drawer. Defaults to the opposite of Drawer.Root swipeDirection. |
variants | No | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Backdrop
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerBackdropState) => 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, DrawerBackdropState> | 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: DrawerBackdropState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Viewport
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerViewportState) => 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, DrawerViewportState> | 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: DrawerViewportState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Popup
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerPopupState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
finalFocus | No | boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefined | Determines the element to focus when the drawer 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, 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 drawer is opened. - 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, or false/undefined to do nothing. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DrawerPopupState> | 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: DrawerPopupState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Content
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerContentState) => 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, DrawerContentState> | 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: DrawerContentState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Header
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Title
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerTitleState) => 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, DrawerTitleState> | 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: DrawerTitleState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Description
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerDescriptionState) => 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, DrawerDescriptionState> | 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: DrawerDescriptionState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Close
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerCloseState) => 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, DrawerCloseState> | 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: DrawerCloseState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.Indent
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerIndentState) => 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, DrawerIndentState> | 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: DrawerIndentState) => 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 | {} | undefined | See the usage contract and declaration. |
SwipeDrawer.IndentBackground
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: DrawerIndentBackgroundState) => 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, DrawerIndentBackgroundState> | 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: DrawerIndentBackgroundState) => 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 | {} | undefined | See the usage contract and declaration. |
Defaults and customization
Descriptor defaults: {}. Parts: trigger, swipe-area, backdrop, viewport, popup, content, header, title, description, close, indent, indent-background. 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/swipe-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.