SelectString
Last updated
Last updated
SelectString
widget in Supervisely is a dropdown menu that allows users to select a single string value from a list of predefined options. It is commonly used when a specific string value is required as input, such as when selecting a specific class name or annotation type. Selected value can be accessed programmatically in the code.
values
List[str]
Determine list of strings for SelectString
widget
labels
Optional[List[str]]
Determine list of label strings
filterable
Optional[bool]
Whether SelectString
is filterable
placeholder
Optional[str]
Input placeholder
size
Optional[Literal["large", "small", "mini", None]]
Size of input
multiple
Optional[bool]
Whether multiple-select is activated
items_right_text
List[str]
Determine text on the right side of each item
items_links
List[str]
Display help text with links for each item
widget_id
Optional[str]
ID of the widget
Determine list of strings for SelectString
widget.
type: List[str]
Determine list of label strings.
type: List[str]
or None
default value: None
Whether SelectString
is filterable.
type: Optional[bool]
default value: false
Input placeholder.
type: Optional[str]
default value: select
Size of input.
type: Optional[Literal["large", "small", "mini", None]]
default value: None
Whether multiple-select is activated.
type: Optional[bool]
default value: false
Determine text on the right side of each item.
type: List[str]
or None
default value: None
Display help text with links for each item.
type: List[str]
or None
default value: None
ID of the widget.
type: Optional[str]
default value: None
get_value()
Return selected item value.
set(values: List[str], labels: Optional[List[str]] = None, right_text: Optional[List[str]] = None,)
Define string options to widget.
get_items()
Return list of items from widget.
@value_changed
Decorator function is handled when input value is changed.
You can find this example in our Github repository:
ui-widgets-demos/blob/master/selection/009_select_string/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Image
widget we will use in UI in this tutorial for demoSelectString
widgetPrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.