Dialog

A modal dialog that interrupts the user with important content and expects a response.

Example

1import { Dialog, Button, FlexBox } from '@sugarcoat/ui';
2
3<FlexBox gap='3' justify='center'>
4 <Dialog>
5 <Dialog.Trigger>Open Dialog</Dialog.Trigger>
6 <Dialog.Content title="Dialog Title">
7 <Typography.Paragraph>
8 🚀 Fasten your seat belts! 🚀
9 </Typography.Paragraph>
10
11 <Typography.Paragraph>
12 Here at SugarcoatUI, we believe in making your development experience as delightful as a candy shop. From responsive GridViews to customizable buttons, our components are designed to make your web applications look good and taste even better.
13 </Typography.Paragraph>
14
15 <Typography.Paragraph>
16 🌟 Highlights: 🌟
17 </Typography.Paragraph>
18
19 <Typography.Paragraph>
20 Accessible out of the box: We've got your back with components that adhere to WCAG standards.
21 Micro-interactions: Sprinkle your UI with animations that make users smile.
22 Efficiency redefined: Time-saving components with a focus on developer experience.
23 Ready to dive into the sweetness? Take a look at our Getting Started guide, or explore the components that catch your eye.
24 </Typography.Paragraph>
25
26 <Typography.Paragraph>
27 🍭 Happy Building! 🍭
28 </Typography.Paragraph>
29 <Dialog.Footer>
30 <Button variant="ghost">Cancel</Button>
31 <Button>Confirm</Button>
32 </Dialog.Footer>
33 </Dialog.Content>
34 </Dialog>
35</FlexBox>
36

API Reference

ComponentDescription
Dialog

A modal dialog that interrupts the user with important content and expects a response.

Dialog.Trigger

The button that opens the dialog. Can be customized with button props.

Dialog.Content

The content of the dialog, including optional title, body, and footer.

Component Properties

Dialog
PropTypeDefaultDescription
overlaybooleantrueWhether to show the overlay behind the dialog.
Dialog.Content
PropTypeDefaultDescription
titlestring-The title displayed in the dialog header.
footerReactNode-Content to be displayed in the dialog footer.
barebonebooleanfalseWhen true, renders without header and footer for custom content.
showCloseButtonbooleantrueWhether to show the close button in the header.
Customize The Look
Check out these sample themes
Or create your ownBrand color
Accent color
Neutral color
Border radius