Overlays
Drawer
A panel from an edge of the window. A swipe closes it on a phone.
Overlays
A panel from an edge of the window. A swipe closes it on a phone.
Change the props on the right, then open the drawer.
import { Button } from 'omuk-ui/button';
import {
Drawer,
DrawerClose,
DrawerContent,
DrawerDescription,
DrawerFooter,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from 'omuk-ui/drawer';
<Drawer>
<DrawerTrigger render={<Button variant="outline" />}>
Open the drawer
</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Activity</DrawerTitle>
<DrawerDescription>Escape, a click on the backdrop or Close puts it away.</DrawerDescription>
</DrawerHeader>
<DrawerFooter>
<DrawerClose render={<Button variant="outline" />}>
Close
</DrawerClose>
</DrawerFooter>
</DrawerContent>
</Drawer>The header and the footer stay in place, and the fields between them scroll. Save closes the drawer from state; DrawerClose closes it with no change.
direction picks the edge. A side drawer is three quarters of the width, up to a limit; a top or a bottom one is the full width, up to four fifths of the height.