Empty

Introduction

Empty widget is a simple placeholder widget that can be used to create empty spaces within a layout.

It has no content or functionality of its own and is typically used to provide spacing or alignment within a larger widget or layout. This widget is particularly useful for creating clean, organized interfaces with clearly defined sections and layouts.

Function signature

empty = Empty(widget_id=None)

Parameters

Parameters
Type
Description

style

str

Specifies an inline style for an element

widget_id

str

ID of the widget

style

Specifies an inline style for an element.

type: str

default value: ""

empty = Empty(style="padding: 5px;")

widget_id

ID of the widget.

type: str

default value: None

Mini App Example

You can find this example in our Github repository:

ui-widgets-demos/layouts and containers/003_empty/src/main.py

Import libraries

Init API client

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

Initialize Empty widget

Prepare some widgets

This widget is useful in other widgets, for example, Select.Item

Create app layout

Prepare a layout for app using Card widget with the content parameter and place widget that we've just created in the Container widget.

Create app using layout

Create an app object with layout parameter.

In this video demonstrated Empty (invisible) and Text widgets that we used in Select widget.

Last updated

Was this helpful?