SelectTeam
Introduction
SelectTeam widget in Supervisely is a dropdown menu that allows users to select a team from a list of available teams. Clicking on it can be processed from python code. This widget is particularly useful when working with multiple teams in Supervisely and allows to easily switch between team in applications.
Function signature
SelectTeam(
default_id=None,
show_label=True,
size=None,
widget_id=None,
)
Parameters
default_id
int
Default supervisely team ID
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size (large/small/mini)
widget_id
str
ID of the widget
default_id
Determine Team will be selected by default.
type: int
default value: None

show_label
Determine show text Team on widget or not.
type: bool
default value: True

size
Size of input.
type: Literal["large", "small", "mini", None]
default value: None

widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
get_selected_id()
Return selected team id.
set_team_id()
Set the selected team ID.
@value_changed
Decorator to handle team selection change event.
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/002_select_team/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare Team ID
Team IDInitialize SelectTeam widget
SelectTeam widgetCreate button and notification box we will use in UI for demo
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 get team ID from widget
team ID from widget
Last updated
Was this helpful?