Skip to main content

Drawer

v.2.1.0

Installation

yarn add @mercell/drawer-react

Usage

Using the Date Picker component is as simple as importing it like this.

import { Drawer } from '@mercell/drawer-react';
Live Editor
Result

Types, definitions, etc.

DrawerProps
interface DrawerProps {
isDrawerVisible: boolean;
onCloseCallback: () => void;
drawerTitle?: ReactNode;
shouldCloseOnOutsideClick?: boolean;
parent?: HTMLElement;
parentClassName?: string;
closeCrossButtonAriaLabel?: string;
ignoreOutsideClickClassName?: string;
showBackdrop?: boolean;
isOutsideClickDisabled?: boolean;
makeDrawerWithInert?: boolean;
} & JSX.IntrinsicElements['button'];
NameTypeDefaultRequiredDescription
isDrawerVisiblebooleanfalseyesState value to set drawer visible or not
onCloseCallback() => void-yesCallback action which will happen on close
drawerTitleReactNode''noTitle inside drawer
shouldCloseOnOutsideClickbooleanfalsenoAllowing to close drawer when click outside the drawer
parentHTMLElementdocument.bodynoElement where portal will mount itself
closeCrossButtonAriaLabelstring'Close'noAria label for close button
ignoreOutsideClickClassNamestring'ignore-outside-click'noClass name which is set inside e.g. button which is triggering drawer
showBackdropbooleanfalsenoOption to dim the background when drawer is open