Switch
Last updated
Last updated
Switch
widget in Supervisely is a user interface element that allows users to toggle between two states, such as on/off or true/false. With the Switch widget, users can easily turn on or off a specific feature or setting. The Switch widget is useful for creating project dashboards that require users to toggle specific options quickly and easily. Users can customize the appearance and behavior of the Switch widget to match their project requirements, making it a flexible tool for creating user interfaces in Supervisely apps. Overall, the Switch widget is a simple yet effective tool for improving the usability and functionality of Supervisely apps.
Parameters | Type | Description |
---|---|---|
|
| Determine |
|
| Width of |
|
| Text displayed when |
|
| Text displayed when |
|
| Background color when |
|
| Background color when |
|
| Determine active |
|
| Determine active |
|
| ID of the widget |
Determine Switch
is ON or OFF.
type: bool
default value: false
Determine Switch
width.
type: int
default value: 58
Determine text displayed when Switch
in ON state.
type: str
default value: ON
Determine text displayed when Switch
in OFF state.
type: str
default value: OFF
Determine background color when Switch
in ON state.
type: str
default value: None
Determine background color when Switch
in OFF state.
type: str
default value: None
Determine active Widget
when Switch
in ON state.
type: Widget
default value: None
Determine active Widget
when Switch
in OFF state.
type: Widget
default value: None
ID of the widget.
type: str
default value: None
Attributes and Methods | Description |
---|---|
| Check |
| Set |
| Set |
| Return |
| Return |
| Set |
| Return |
| Set |
| Return |
| Set |
| Return |
| Set |
| Decorator function is handled when |
You can find this example in our Github repository:
ui-widgets-demos/controls/004_switch/src/main.py
Switch
widgetOneOf
widget to switch between Cards
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 an app object with layout parameter.