import React, { Fragment, useState } from 'react'; import { Drawer } from 'reablocks'; import { DrawerHeader } from 'reablocks'; import { DrawerContent } from 'reablocks'; import { DrawerFooter } from 'reablocks'; import { Button } from 'reablocks'; export default { title: 'Components/Layers/Drawer', component: Drawer }; export const Simple = () => { const [open, setOpen] = useState(false); return ( setOpen(true)}> Open setOpen(false)}> Drawer Title Hello There! ); }; export const WithFooter = () => { const [open, setOpen] = useState(false); return ( setOpen(true)}> Open setOpen(false)}> Edit Settings This is the drawer content. You can put any content here including forms, lists, or other components. setOpen(false)}>Cancel Save ); }; export const WithForm = () => { const [open, setOpen] = useState(false); return ( setOpen(true)}> Open Form Drawer setOpen(false)} size="400px"> { e.preventDefault(); alert('Form submitted!'); setOpen(false); }} > Create New Item Title Description setOpen(false)}> Cancel Create ); }; export const BottomSheet = () => { const [open, setOpen] = useState(false); return ( setOpen(true)}> Open Bottom Sheet setOpen(false)} position="bottom" size="300px" > Bottom Sheet This is a bottom sheet style drawer. setOpen(false)} className="w-full"> Close ); }; export const LeftDrawer = () => { const [open, setOpen] = useState(false); return ( setOpen(true)}> Open Left Drawer setOpen(false)} position="start"> Navigation Home Products About Contact ); }; export const CustomAnimation = () => { const [isOpen, setIsOpen] = useState(false); return ( setIsOpen(!isOpen)}> Open setIsOpen(false)} > Custom Animation This drawer has a custom animation! ); };
Hello There!
This is the drawer content. You can put any content here including forms, lists, or other components.
This is a bottom sheet style drawer.
This drawer has a custom animation!