Pagination
Introduction
Pagination
is a widget that allows to use page selection. If you have too much data to display in one page, use pagination.
Function signature
Parameters
total
Determine the total items count.
type: int
page_size
Determine the item count of each page.
type: int
default value: 10
current_page
Determine the current page number.
type: int
default value: 1
layout
Determine the layout for Pagination
, elements separated with a comma. Possible values: sizes, prev, pager, next, jumper, ->, total, slot
.
sizes
- item count per page optionsprev
- previous page buttonpager
- page number buttonsnext
- next page buttonjumper
- jump to page input->
- moves widget to the right sidetotal
- total item count
type: str
default value: "prev, pager, next, jumper, ->, total"
compact
Determine whether to use small pagination.
type: bool
default value: False
page_size_options
Determine options of item count per page.
type: List[int]
default value: [10, 20, 30, 40, 50, 100]
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/controls/009_pagination/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize Pagination
and Text
widgets
Pagination
and Text
widgetsCreate app layout
Prepare a layout for app using Card
widget with the content
parameter.
Create app using layout
Create an app object with layout parameter.
Add functions to control widgets from python code
Last updated