UNPKG

@base-ui/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

45 lines 1.45 kB
import * as React from 'react'; import type { BaseUIComponentProps } from "../../utils/types.js"; import { type SwipeDirection } from "../../utils/useSwipeDismiss.js"; import { type DrawerSwipeDirection } from "../root/DrawerRootContext.js"; /** * An invisible area that listens for swipe gestures to open the drawer. * Renders a `<div>` element. * * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer) */ export declare const DrawerSwipeArea: React.ForwardRefExoticComponent<Omit<DrawerSwipeAreaProps, "ref"> & React.RefAttributes<HTMLDivElement>>; export interface DrawerSwipeAreaProps extends BaseUIComponentProps<'div', DrawerSwipeArea.State> { /** * Whether the swipe area is disabled. * @default false */ disabled?: boolean | undefined; /** * The swipe direction that opens the drawer. * Defaults to the opposite of `Drawer.Root` `swipeDirection`. */ swipeDirection?: DrawerSwipeDirection | undefined; } export interface DrawerSwipeAreaState { /** * Whether the drawer is currently open. */ open: boolean; /** * Whether the swipe area is currently being swiped. */ swiping: boolean; /** * The swipe direction that opens the drawer. */ swipeDirection: SwipeDirection; /** * Whether the swipe area is disabled. */ disabled: boolean; } export declare namespace DrawerSwipeArea { type Props = DrawerSwipeAreaProps; type State = DrawerSwipeAreaState; }