Flexbox
Introduction
Flexbox
widget in Supervisely is a widget that enables users to arrange other widgets in a flexible and responsive layout. Users can customize the layout by setting the gap between widgets and aligning them to the center. With the Flexbox
widget, users can easily create dynamic and adaptable layouts that can be optimized for different devices and screen sizes
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| List if widgets to display in |
|
| Gap between widgets in |
|
| Determines whether to place widgets in the center of the window |
|
| ID of the widget |
widgets
Determine list of Widgets
to display in Flexbox
widget.
type: List[Widget]
gap
Determine gap between Widgets
on Flexbox
.
type: int
default value: 10
center_content
Determines whether to place widgets in the center of the window.
type: bool
default value: False
widget_id
ID of the widget.
type: str
default value: None
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/layouts and containers/005_flexbox/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize widgets we will use in UI
Initialize Flexbox
widget
Flexbox
widgetCreate 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.
Last updated