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";
//or
import { 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

Dialog Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
maxWidthnumber-A number in pixels which determines the `max-width` of the dialog.
fullScreenbooleanfalseIf true, the dialog will be full-screen.
openbooleanfalseIf true, the dialog will be open.
onOpenfunction-The callback fires when the dialog has opened.
onClosefunction-The callback fires when the dialog has closed.
onBackdropClickfunction-Callback fired when the backdrop is clicked.
Signature: function(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void
onEscapeKeyUpfunction-Callback fired when the Escape key is released.
Signature: function(event: KeyboardEvent) => void
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

DialogHeader Properties

DialogHeader Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-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.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

DialogBody Properties

DialogBody Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

DialogActionBar Properties

DialogActionBar Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.