TabsDynamic
Introduction
TabsDynamic is a versatile widget in Supervisely that allows users to display and edit YAML files within their info, such as NN model settings. The widget can divide the YAML file into separate tabs, making it easier to navigate and manage complex data structures. Additionally, users can edit the YAML directly within the widget and obtain a merged YAML file with their changes. TabsDynamic also enables users to get or set the active tab from code.
Function signature
TabsDynamic(
filepath_or_raw_yaml,
type="border-card",
disabled=False,
widget_id=None,
)
Parameters
filepath_or_raw_yaml
str
Path to yaml file or string
type
Literal["card", "border-card"]
Determine style of widget tabs
disabled
bool
Disable widget
widget_id
str
ID of the widget
filepath_or_raw_yaml
Determine path to yaml input file or string.
type: str

type
Determine style of widget tabs.
type: Literal["card", "border-card"]
default value: border-card


disabled
Disable widget.
type: bool
default value: false

widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
set_active_tab()
Set active tab.
get_active_tab()
Return active tab.
get_merged_yaml()
Return merged yaml.
disable()
Disable widget.
enable()
Enable widget.
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/layouts and containers/013_tabs_dynamic/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize TabsDynamic widget
TabsDynamic widgetCreate 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.

Last updated
Was this helpful?