Skip to main content

Drawer

Example

import { Drawer } from 'chic-ui';

export const SampleDrawer = () => {
const [open, setOpen] = React.useState(false);
const handleClose = () => setOpen(!open);
return (
<>
<button onClick={handleClose}>Open Drawer</button>
<Drawer
open={open}
size="default"
closable={true}
placement="bottom"
header="Header Content"
footer="Footer content"
onClose={handleClose}
>
<div>Some contents...</div>
<div> Some contents...</div>
<div> Some contents...</div>
</Drawer>
</>
);
};

API

import { Drawer } from 'chic-ui';
NameTypeDefaultDescription
size'default' | 'large''default'Size of the drawer. 'default` size is 378px and `large` size is 736px
closablebooleantrueBoolean to determine if drawer can be closed
placement'top' | 'right' | 'bottom' | 'left'Placement of the tooltip
onClosefunctionSpecify a function that will be called when the Drawer is closed
placement'left' | 'right' | 'top' | 'bottom''right'Placement of the drawer
openbooleanfalseBoolean to determine if drawer is open
childrenReactNodeContents of the drawer
headerReactNodeHeader of the drawer
footerReactNodeFooter of the drawer
heightnumberHeight for top and bottom placement. Will override size property
widthnumberWidth for top and bottom placement. Will override size property
classNamestringProvide external classnames to the component
styleReact.CSSPropertiesOverride default styling of the component
headerStyleReact.CSSPropertiesOverride default styling of the header
bodyStyleReact.CSSPropertiesOverride default styling of the contents of the drawer
footerStyleReact.CSSPropertiesOverride default styling of the footer