Grid
Introduction
Grid
widget in Supervisely is a widget that enables users to arrange other widgets in a flexible and responsive grid layout. Users can customize the layout by setting the gap between widgets and number of columns. With the Grid
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 on |
|
| Number of columns on |
|
| Gap between widgets on |
|
| ID of the widget |
widgets
Determine list of Widgets
to display on Grid
.
type: List[Widget]
columns
Number of columns on Grid
.
type: int
default value: 1
gap
Determine gap between Widgets
on Grid
.
type: int
default value: 10
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/006_grid/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 Grid
widget
Grid
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