Drawer
The Drawer component provides a hidden or off-canvas panel that can slide in or out from the edge of the screen, offering additional navigation or content without obstructing the main interface. One common use case is when user is analysing a list of entries from a table and they quickly wants to see details for some entries.
Usage
The Drawer component uses a slot-based API for its structure. Use DrawerHeader, DrawerContent, and DrawerFooter as child components to compose your drawer:
import { Drawer, DrawerHeader, DrawerContent, DrawerFooter } from 'reablocks';
<Drawer open={open} onClose={() => setOpen(false)}>
<DrawerHeader>Drawer Title</DrawerHeader>
<DrawerContent>
{/* Your content here */}
</DrawerContent>
<DrawerFooter>
{/* Footer actions here */}
</DrawerFooter>
</Drawer>All three slots are optional - you can use any combination of them based on your needs.
Examples
Basic example
Drawer as bottom sheet
Custom Animation
Define custom animations for the drawer, using the animation, animationViewChange props:
Learn more about how to customize the animations in the Custom Animations section.
Theme
This component uses the following default theme:
- root{}(7 keys)
- Show all
Learn more about how to customize in the Theme documentation.