Text widget in Supervisely is used to display text with different styles, such as "text", "info", "success", "warning", or "error". Content and style of the text can be easily changed drom code. The Text widget is useful for presenting informative messages or status updates to users, and can be combined with other widgets to create more complex interfaces.
text =Text( text="Lorem ipsum dolor sit amet... anim id est laborum.", status="text",)
Create app layout
Prepare a layout for app using Card widget with the content parameter and place 2 widgets that we've just created in the Container widget. Place order in the Container is important, we want the message text to be displayed below the buttons.
card =Card( title="Text", description="👉 Click on the button to change text highlighting", content=Container(widgets=[buttons_container, text]),)layout =Container(widgets=[card], direction="vertical")
Create app using layout
Create an app object with layout parameter.
app = sly.Application(layout=layout)
Our app layout is ready.
Start text status change with button click
Use the decorator as shown below to handle button click. Text will be updating it status after pressing corresponding button.