RadioTabs

Introduction

RadioTabs is a graphical user interface tool in Supervisely that allows users to group related widgets into tabs and switch between them using radio buttons. This feature is particularly useful for organizing and presenting complex interfaces with multiple settings and options. RadioTabs offers a simple and intuitive interface for users to quickly navigate between different tabs and access the desired widgets.

Function signature

RadioTabs(
    titles=["Info tab", "Success tab"],
    contents=[
        Text("Info text", status="info"),
        Text("Success text", status="success")
    ],
    descriptions=None,
    widget_id=None,
)

Parameters

Parameters
Type
Description

titles

List[str]

List of the tabs titles

contents

List[Widget]

List of tabs content

descriptions

List[str]

List of tabs descriptions

widget_id

str

ID of the widget

titles

Determine list of the tabs titles.

type: List[str]

contents

Determine list of the tabs content.

type: List[Widget]

descriptions

Determine list of tabs descriptions.

type: List[str]

default value: None

widget_id

ID of the widget.

type: str

default value: None

Methods and attributes

Attributes and Methods
Description

set_active_tab(value: str)

Set active tab by title.

get_active_tab()

Return active tab title.

@value_changed

Decorator function handled when RadioTabs value is changed.

Mini App Example

You can find this example in our Github repository:

ui-widgets-demos/layouts and containers/011_radio_tabs/src/main.py

Import libraries

Init API client

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

Initialize RadioTabs widgets

Initialize Text widget to change text on widget

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.

Add functions to control widgets from python code

Last updated

Was this helpful?