DialogMessage

Introduction

show_dialog widget in Supervisely is a function that is used to display a modal dialog window with customizable content. Users can specify the title, message, and status of the dialog window, such as informational, success, warning, or error.

Function signature

sly.app.show_dialog(
    title,
    description,
    status="info",
)

Parameters

Parameters
Type
Description

title

str

Dialog window title

description

str

Dialog window description text

status

Literal["info", "success", "warning", "error"]

Dialog window status

title

Dialog window title.

type: str

description

Dialog window description.

type: str

status

Dialog window status.

type: Literal["info", "success", "warning", "error"]

default value: info

Mini App Example

You can find this example in our Github repository:

ui-widgets-demos/status elements/004_dialog_message/src/main.py

Import libraries

Init API client

First, we load environment variables with credentials and init API for communicating with Supervisely Instance:

Initialize Button widgets we will use

Create app layout

Prepare a layout for app using Card widget with the content parameter.

Create app using card

Create an app object with card parameter.

Add functions to control Button widgets from python code and use show_dialog widget

Last updated

Was this helpful?