Drawer

Drawer UI Component

Installation

npm i @synerise/ds-drawer
or
yarn add @synerise/ds-drawer

Usage

import Drawer from '@synerise/ds-drawer'
<Drawer
visible={true}
width={400}
onClose={() => {}}
>
<Drawer.DrawerHeader>
<span>Header</span>
</Drawer.DrawerHeader>
<Drawer.DrawerBody>
<Drawer.DrawerContent>
<p>Content</p>
</Drawer.DrawerContent>
</Drawer.DrawerBody>
</Drawer>

Demo

API

PropertyDescriptionTypeDefault
destroyOnCloseWhether to unmount child components on closing drawer or not.booleanfalse
getContainerReturn the mounted node for Drawer.() => HTMLElementSelectors
maskWhether to show mask or not.booleantrue
maskClosableClicking on the mask (area outside the Drawer) to close the Drawer or not.booleantrue
maskStyleStyle for Drawer's mask element.object{}
styleStyle of wrapper element which contains mask compare to drawerStyleobject{}
drawerStyleStyle of the popup layer elementobject{}
visibleWhether the Drawer dialog is visible or not.booleanfalse
widthWidth of the Drawer dialog.string / number256
heightplacement is top or bottom, height of the Drawer dialog.string / number256
classNameThe class name of the container of the Drawer dialog.string-
zIndexThe z-index of the Drawer.number1000
placementThe placement of the Drawer.top / left / right / bottom / right
onCloseSpecify a callback that will be called when a user clicks mask, close button or Cancel button.(e:Event) => void-
afterVisibleChangeCallback after the animation ends when switching drawers.(visible: boolean) => void-
keyboardWhether support press esc to closebooleantrue