Sidebar

Introduction

Sidebar widget from Supervisely is a tool that provides quick access to important information and features in Supervisely apps. Sidebar is a vertical panel that appears on the left side of the app interface and includes widget user will placed in. Sidebar widget is a useful tool for streamlining workflows and improving user productivity in the apps.

Function signature

Sidebar(
    left_content=Button(),
    right_content=Card("Input", content=Input()),
    width_percent=25,
    widget_id=None,
)

Parameters

Parameters
Type
Description

left_content

Widget

Widget to display in left part of Sidebar

right_content

Widget

Widget to display in right part of Sidebar

width_percent

int

Width of the left part of Sidebar in %

height

str

Height of sidebar, can be set in px, % or hv

standalone

bool

Add paddings for full screen apps

widget_id

str

Id of the widget

left_content

Determine Widget to display in left part of Sidebar.

type: Widget

right_content

Determine Widget to display in right part of Sidebar.

type: Widget

width_percent

Determines width of the left part of Sidebar in %.

type: int

default value: 25

height

Height of sidebar, can be set in px,% or hv.

type: str

standalone

Add paddings for full screen apps.

type: bool

default value: False

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/009_sidebar/src/main.py

Import libraries

Init API client

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

Initialize left and right widgets

Initialize Sidebar widget

Create app using layout

Create an app object with layout parameter.

Last updated

Was this helpful?