Menu

Introduction

Menu widget from Supervisely is a useful tool for organizing and navigating in Supervisely apps. With Menu widget, users can create custom menus that shows different parts and widgets of the app. These menus can be organized by groups.

Function signature

Menu(
    items=None,
    groups=None,
    index=None,
    width_percent=25,
    widget_id=None,
)

Parameters

Parameters
Type
Description

items

List[Menu.Item]

List of Menu Items

groups

List[Menu.Group]

List of Menu Groups

index

str

Sets the active Menu at the given index

width_percent

int

Width of the left part of Menu in %

widget_id

str

ID of the widget

items

Determine list of menu Items.

type: List[Menu.Item]

default value: None

groups

Determine list of menu Groups.

type: List[Menu.Group]

default value: None

index

Sets the active Menu at the given index.

type: str

default value: None

width_percent

Determines width of the left part of Menu in %.

type: int

default value: 25

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/007_menu/src/main.py

Import libraries

Init API client

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

Initialize Menu items

Initialize Menu groups

Initialize Menu widget

Create app using layout

Create an app object with layout parameter.

Last updated

Was this helpful?