ElementTag widget in Supervisely is a widget that allows users to display elements tag in the UI.
Function signature
ElementTag(text="", type=None, hit=False, color="", widget_id=None)
Parameters
Type
Description
Literal["primary", "gray", "success", "warning", "danger", None]
Whether ElementTag has a highlighted border
Background color of the ElementTag
Determine ElementTag text.
type: str
el_tag = ElementTag(text="Tag example")
Determine ElementTag theme.
type: Literal["primary", "gray", "success", "warning", "danger", None]
default value: None
Determine whether ElementTag has a highlighted border.
type: bool
default value: False
Determine background color of the ElementTag.
type: str
default value: ""
ID of the widget
type: str
default value: None
Methods and attributes
Attributes and Methods
Description
Set ElementTag hit value.
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/text elements/008_element_tag/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
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.