Skip to content
fayeuiStatic / 0.1.0
LLMs
API / Static edition

@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

NameKindResolved declaration type
SwipeDrawervalue{ 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

PropertyRequiredTypeMeaning
actionsRefNoReact.RefObject<DrawerRootActions | null> | undefinedA 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.
childrenNoReact.ReactNode | PayloadChildRenderFunction<Payload>The content of the drawer.
defaultOpenNoboolean | undefinedWhether the drawer is initially open. To render a controlled drawer, use the open prop instead.
defaultSnapPointNoDrawerSnapPoint | null | undefinedThe initial snap point value when uncontrolled.
defaultTriggerIdNostring | null | undefinedID of the trigger that the drawer is associated with. This is useful in conjunction with the defaultOpen prop to create an initially open drawer.
disablePointerDismissalNoboolean | undefinedWhether 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.
handleNoDrawerHandle<Payload> | undefinedA 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.
modalNoboolean | "trap-focus" | undefinedDetermines 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.
onOpenChangeNo((open: boolean, eventDetails: DrawerRoot.ChangeEventDetails) => void) | undefinedEvent handler called when the drawer is opened or closed.
onOpenChangeCompleteNo((open: boolean) => void) | undefinedEvent handler called after any animations complete when the drawer is opened or closed.
onSnapPointChangeNo((snapPoint: DrawerSnapPoint | null, eventDetails: DrawerRoot.SnapPointChangeEventDetails) => void) | undefinedCallback fired when the snap point changes.
openNoboolean | undefinedWhether the drawer is currently open.
snapPointNoDrawerSnapPoint | null | undefinedThe currently active snap point. Use with onSnapPointChange to control the snap point.
snapPointsNoDrawerSnapPoint[] | undefinedSnap 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').
snapToSequentialPointsNoboolean | undefinedDisables velocity-based snap skipping so drag distance determines the next snap point.
swipeDirectionNoSwipeDirection | undefinedThe swipe direction used to dismiss the drawer.
triggerIdNostring | null | undefinedID 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

PropertyRequiredTypeMeaning
childrenNoReact.ReactNodeSee the usage contract and declaration.

SwipeDrawer.VirtualKeyboardProvider

PropertyRequiredTypeMeaning
childrenNoReact.ReactNodeSee the usage contract and declaration.

SwipeDrawer.Portal

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerPortalState) => 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, DrawerPortalState> | 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: DrawerPortalState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.

SwipeDrawer.Trigger

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerTriggerState) => 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 drawer. Can be created with the Drawer.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 drawers in controlled mode (with the Drawer.Root 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 drawer when it is opened.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DrawerTriggerState> | 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: DrawerTriggerState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.SwipeArea

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerSwipeAreaState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
disabledNoboolean | undefinedWhether the swipe area is disabled.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DrawerSwipeAreaState> | 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: DrawerSwipeAreaState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
swipeDirectionNoSwipeDirection | undefinedThe swipe direction that opens the drawer. Defaults to the opposite of Drawer.Root swipeDirection.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Backdrop

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerBackdropState) => 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, DrawerBackdropState> | 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: DrawerBackdropState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Viewport

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerViewportState) => 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, DrawerViewportState> | 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: DrawerViewportState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Popup

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerPopupState) => 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 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.
initialFocusNoboolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void) | undefinedDetermines 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.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DrawerPopupState> | 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: DrawerPopupState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Content

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerContentState) => 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, DrawerContentState> | 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: DrawerContentState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Header

PropertyRequiredTypeMeaning
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Title

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerTitleState) => 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, DrawerTitleState> | 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: DrawerTitleState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Description

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerDescriptionState) => 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, DrawerDescriptionState> | 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: DrawerDescriptionState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Close

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerCloseState) => 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, DrawerCloseState> | 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: DrawerCloseState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.Indent

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerIndentState) => 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, DrawerIndentState> | 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: DrawerIndentState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee the usage contract and declaration.

SwipeDrawer.IndentBackground

PropertyRequiredTypeMeaning
classNameNostring | ((state: DrawerIndentBackgroundState) => 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, DrawerIndentBackgroundState> | 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: DrawerIndentBackgroundState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{} | undefinedSee 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.