UI

Dialog

Dialog modal displayed on top of the page.

Import Dialog

Tremor exports two components to create a dialog.

import { Dialog, DialogPanel } from '@tremor/react';

Usage example

The example below shows a Dialog used as a success indicator.

API Reference: Dialog

open
Required
Boolean
Whether or not the `Dialog is `open`.
onClose
Required
function

Default: (false) => void;

Callback when the dialog is closed, typically used to update `open` to false.
initialFocus
React.MutableRefObject
Refers to the element that should initially gain focus.
as
String | Component

Default: div

Specifies the component or element type that the Dialog will use for rendering.
static
Boolean

Default: false

Whether the element should ignore the internally managed open/closed state.
unmount
Boolean

Default: true

Whether the element should be unmounted or hidden based on the open/closed state.

API Reference: DialogPanel

as
String | Component

Default: div

Controls whether the component is removed from the DOM or merely hidden, based on its open/closed status.

Theming

Dialog

This component does not have any tokens for styling.

DialogPanel

Background color
colorstremor-background-DEFAULT
Text color
colorstremor-content-DEFAULT
Ring color
colorstremor-ring-DEFAULT
Roundness
borderRadiustremor-default