dialogs#

Various kinds of dialogs.

class Dialog(*args: Any, id: ID | None = None, **kwargs: Any)[source]#

A floating, movable and resizable container for UI elements.

Note

This model and all its properties is experimental and may change at any point.

bottom_limit#

Optional bottom movement or resize limit.

Together with top_limit, left_limit and right_limit it forms a bounding box for movement and resizing of this dialog.

closable#

Determines whether to allow to close the dialog.

Property close_action determines what happens when a dialog is closed. Note that even if dialog can’t be closed through the UI, it can be closed programmatically.

close_action#

Determines the action when closing a dialog.

Options are:

  • "hide" - Removes the dialog from the DOM, but keeps its

    view “alive”, so that it can be opened another time.

  • "destroy" - Destroys the associated view and the state

    it stores. A dialog needs to be rebuilt with a fresh state before it can be opened again.

collapsible#

Determines whether to allow to collapse the dialog.

A collapsed dialog only shows its title, while its content is hidden from the view. This allows keep a dialog open while having a better accesses to UIs below it.

Note

A dialog can be collapsed by scrolling on its title.

content#

The contents of this dialog.

This can be either a plain text string, a DOM node, a UI element or a layout.

left_limit#

Optional left movement or resize limit.

Together with top_limit, bottom_limit and right_limit it forms a bounding box for movement and resizing of this dialog.

maximizable#

Determines whether to allow to maximize the dialog.

A maximized dialog covers the entire viewport area. Multiple dialogs can be maximized at the same time, but only one will be at the top of the viewport.

minimizable#

Determines whether to allow to minimize the dialog.

Minimizing a dialog means collapsing it and moving it to a designated “minimization” area in the bottom left corner of the viewport.

movable#

Determines whether or in which directions a dialog can be moved.

pinnable#

Determines whether to allow to pin the dialog.

A pinned dialog always stays on top of other dialogs. Pinning one dialog unpins any other dialogs.

resizable#

Determines whether or in which directions a dialog can be resized.

right_limit#

Optional right movement or resize limit.

Together with top_limit, bottom_limit and left_limit it forms a bounding box for movement and resizing of this dialog.

symmetric#

Determines if resizing one edge or corner affects the opposite one.

title#

The title of the dialog.

This can be either a plain text string, a DOM node, a UI element or a layout.

top_limit#

Optional top movement or resize limit.

Together with bottom_limit, left_limit and right_limit it forms a bounding box for movement and resizing of this dialog.