@yamada-ui/modal
Version:
Yamada UI modal component
78 lines (75 loc) • 2.21 kB
TypeScript
import * as _yamada_ui_motion from '@yamada-ui/motion';
import { ThemeProps, CSSUIObject } from '@yamada-ui/core';
import { SlideProps } from '@yamada-ui/transitions';
import { ModalProps } from './modal.js';
import '@yamada-ui/focus-lock';
import '@yamada-ui/portal';
import './modal-content.js';
import 'react';
interface DrawerOptions {
/**
* If `true`, then the drawer will close on drag.
*
* @default false
*/
closeOnDrag?: boolean;
/**
* Applies constraints on the permitted draggable area.
*
* @default 0
*/
dragConstraints?: number;
/**
* The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.
*
* @default 0.1
*/
dragElastic?: number;
/**
* Offset from being dragged to closing.
*
* @default 80
*/
dragOffset?: number;
/**
* Velocity of the drag that triggers close.
*
* @default 100
*/
dragVelocity?: number;
/**
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).
*/
fullHeight?: boolean;
/**
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100dvh).
*
* @deprecated Use `fullHeight` instead.
*/
isFullHeight?: boolean;
/**
* The placement of the drawer.
*
* @default 'right'
*/
placement?: SlideProps["placement"];
/**
* If `true`, display the drag bar when `closeOnDrag` is `true`.
*
* @default true
*/
withDragBar?: boolean;
/**
* Props for the blank area when `closeOnDrag` is `true`.
*/
blankForDragProps?: CSSUIObject;
}
interface DrawerProps extends Omit<ModalProps, "animation" | "dragConstraints" | "dragElastic" | "outside" | "placement" | "scrollBehavior" | keyof ThemeProps>, ThemeProps<"Drawer">, DrawerOptions {
}
/**
* `Drawer` is a component for a panel that appears from the edge of the screen.
*
* @see Docs https://yamada-ui.com/components/overlay/drawer
*/
declare const Drawer: _yamada_ui_motion.MotionComponent<"div", DrawerProps>;
export { Drawer, type DrawerProps };