SelectTagMeta
Introduction
SelectTagMeta widget in Supervisely is a drop down menu that allows users to select a TagMeta from a list of available tag metadatas. The widget can be customized with various parameters, such as the default selected tag metadata, default project ID, size, allowed types, multiple selection, label showing.
Function signature
SelectTagMeta(
default=None,
project_id=None,
project_meta=None,
allowed_types=None,
multiselect=False,
show_label=True,
size=None,
widget_id=None,
)
Parameters
default
str
Tag name
project_id
int
Determine Project from which Tags will be selected.
project_meta
ProjectMeta
Determine ProjectMeta from which Tags will be selected
allowed_types
List[str]
Determine Tags types witch will be available to select from all Project Tags
multiselect
bool
Allows to select multiple Tags
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size
widget_id
str
ID of the widget
default
Determine Tag will be selected by default.
type: str
default value: None

project_id
Determine Project from which Tags will be selected.
type: int
default value: None

project_meta
Determine ProjectMeta from which Tags will be selected.
type: ProjectMeta
default value: None

allowed_types
Determine Tags types witch will be available to select from all Project Tags. Possible Tag types: any_number, any_string, one_of_string, none.
type: List[str]
default value: None

multiselect
Allows to select multiple Tags.
type: bool
default value: False

show_label
Determine show text Tag 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_name()
Return selected tag name. If multiselect is True raise RuntimeError.
get_selected_names()
Return List with selected Tag names. If multiselect is False raise RuntimeError.
get_tag_meta_by_name(name: str)
Return TagMeta by Tag name.
get_selected_item()
Return TagMeta for selected Tag.
get_selected_items()
Return List, containing TagMeta for selected tags.
set_name(name: str)
Set Tag with given name as selected.
set_names(names: List[str])
Set Tags from given list of Tag names as selected. If multiselect is False raise RuntimeError.
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/007_select_tag_meta/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare Project ID
Project IDInitialize SelectTagMeta widget
SelectTagMeta 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?