Button widget in Supervisely is a user interface element that allows users to create clickable buttons in the appliactions. These buttons can be customized with text, size, colors, and icons, and can be used to trigger specific actions or workflows. The Button widget is a versatile tool that can help users automate repetitive tasks or streamline their workflows, making it a valuable addition to any project dashboard.
Init API for communicating with Supervisely Instance. First, we load environment variables with credentials:
Initialize Button and Text widgets
Create app layout
Prepare a layout for app using Card widget with the content parameter and place 3 widgets that we've just created in the Container widget. Place order in the Container is important, we want buttons to be displayed above Text widget.
Create app using layout
Create an app object with layout parameter.
Our app layout is ready. It's time to handle button clicks.
Handle button clicks
Use the decorator as shown below to handle button click. We have 2 buttons, one for adding and another one for subtracting