Dialog
The Dialog component serves as a pop-up or modal window that overlays the main content, allowing the display of important messages, forms, or user interactions while grabbing user’s focus.
Usage
The Dialog component uses a slot-based API for its structure. Use DialogHeader, DialogContent, and DialogFooter as child components to compose your dialog:
import { Dialog, DialogHeader, DialogContent, DialogFooter } from 'reablocks';
<Dialog open={open} onClose={() => setOpen(false)}>
<DialogHeader>Dialog Title</DialogHeader>
<DialogContent>
{/* Your content here */}
</DialogContent>
<DialogFooter>
{/* Footer actions here */}
</DialogFooter>
</Dialog>All three slots are optional - you can use any combination of them based on your needs.
Examples
Basic Dialog
Dialog with Footer and Custom header
Custom Animation
Define custom animations for the dialog, 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{}(5 keys)
- Show all
Learn more about how to customize in the Theme documentation.
API
Last updated on