Dialog
Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks.
Dialogs disable all app functionality when they appear, and remain on screen until confirmed, dismissed, or a required action has been taken.
Dialogs are purposefully interruptive, so they should be used sparingly.
Sonnat's Dialogs are fully customizable. We have implemented the basic features so you can add your own features without any problem / overriding hells.
Dialogs have a maxHeight of 70vh
. If the height exceeds the maxHeight value it will automatically make the UI scrollable and also will add some elevation to the Header and the ActionBar.
Basic Dialog
Fullscreen Dialog
To have a fullscreen dialog, use the fullScreen
property.
API
Learn more about the properties and the customization points.
Usage
import Dialog, {DialogHeader,DialogBody,DialogActionBar} from "@sonnat/ui/Dialog";//orimport { Dialog, DialogHeader, DialogBody, DialogActionBar } from "@sonnat/ui";
Properties
Note that the documentation avoids mentioning all the native props (there are a lot) in this section of the components.
Dialog Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
maxWidth | number | - | A number in pixels which determines the `max-width` of the dialog. |
fullScreen | boolean | false | If true , the dialog will be full-screen. |
open | boolean | false | If true , the dialog will be open. |
onOpen | function | - | The callback fires when the dialog has opened. |
onClose | function | - | The callback fires when the dialog has closed. |
onBackdropClick | function | - | Callback fired when the backdrop is clicked. Signature: function(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void |
onEscapeKeyUp | function | - | Callback fired when the Escape key is released.Signature: function(event: KeyboardEvent) => void |
|
DialogHeader Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
title required | string | - | The title to display in the header. |
|
DialogBody Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
|
DialogActionBar Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
|