UNPKG

@cimpress/react-components

Version:
60 lines 2.19 kB
import React, { CSSProperties, ReactNode } from 'react'; import { Direction } from './common'; import { PublicComponentProps } from './types'; export interface DrawerProps extends PublicComponentProps { /** * Whether to resize the drawer proportionally on window resize. */ autoResize?: boolean; /** * Inline styles to be applied to the drawer body div. */ bodyStyle?: CSSProperties; /** * Body of the drawer. By default, this area will be vertically scrollable if it doesn't fit on the page. */ children?: ReactNode; /** * Controls whether or not the drawer should close when a click occurs outside of the component. */ closeOnClickOutside?: boolean; /** * Footer for the drawer. Any buttons with actions should go here. If no footer is provided, the drawer will not render with a footer section. */ footer?: ReactNode; /** * Inline styles to be applied to the drawer footer div. */ footerStyle?: CSSProperties; /** * Header for the drawer. If no header is provided, the drawer will not render with a header section. */ header?: ReactNode; /** * Inline styles to be applied to the drawer header div. */ headerStyle?: CSSProperties; /** * Function to be called when the drawer wants to close. */ onRequestHide?: () => void; /** * The side of the screen on which to display the drawer. */ position?: Direction; /** * Controls whether or not the drawer is displayed. */ show: boolean; /** * Width/height of drawer depending on drawer position i.e. [left, right] or [top, bottom] . * If `autoResize` is true, `size` is a fraction of window width/height; otherwise, `size` is in pixels. */ size?: number; /** * z-index value to be be used for Drawer wrapper. */ zIndex?: number; } export declare const Drawer: ({ autoResize, bodyStyle, children, className, closeOnClickOutside, footer, footerStyle, header, headerStyle, onRequestHide, position, show, size, style, zIndex, ...rest }: DrawerProps) => React.ReactPortal; //# sourceMappingURL=Drawer.d.ts.map