Skip to main content

Pagination

Rocket 2.0

The Pagination component shows page numbers with Previous and Next buttons, so the user can move through long lists of records one page at a time. Read the current page in a query to fetch the matching rows.

Properties​

Property
Description
Expected Value
Number of pagesHow many pages there are. Ignored when Total records is set.Number. Default: 10
Total records (instead of pages)Total number of records to page through. When set, the number of pages is worked out from this and Page size.Text
Page size (with total records)Number of records on each page, used with Total records.Number. Default: 10
Default page indexPage shown when the app loads. When it changes later, the pager moves to that page and fires On page change.Number. Default: 1
Current pageThe page that is selected. It updates as the user moves between pages.Number. Default: 1
Pages beside the current oneHow many page numbers to show on each side of the current page before the rest collapse into an ellipsis.Number. Default: 1
First and last buttonsShows buttons that jump to the first and last page.On or off. Default: Off
Previous / Next labelsShows the words Previous and Next next to the arrows. They are dropped when the pager is too narrow.On or off. Default: On
SizeSize of the page buttons.Sm, Default. Default: Default

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On page changeTriggers when the user moves to another page.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set pageMoves to the given Page and fires On page change.components.pagination1.setPage("")
Set visibilityShows the component when true, hides it when false.components.pagination1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.pagination1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.pagination1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
numberOfPagesHow many pages there are. Ignored when Total records is set.{{components.pagination1.numberOfPages}}
totalRecordsTotal number of records to page through. When set, the number of pages is worked out from this and Page size.{{components.pagination1.totalRecords}}
pageSizeNumber of records on each page, used with Total records.{{components.pagination1.pageSize}}
defaultPageIndexPage shown when the app loads. When it changes later, the pager moves to that page and fires On page change.{{components.pagination1.defaultPageIndex}}
currentPageIndexThe page that is selected. It updates as the user moves between pages.{{components.pagination1.currentPageIndex}}
siblingCountHow many page numbers to show on each side of the current page before the rest collapse into an ellipsis.{{components.pagination1.siblingCount}}
showFirstLastShows buttons that jump to the first and last page.{{components.pagination1.showFirstLast}}
showLabelsShows the words Previous and Next next to the arrows. They are dropped when the pager is too narrow.{{components.pagination1.showLabels}}
sizeSize of the page buttons.{{components.pagination1.size}}
totalPagesThe number of pages, including the one worked out from Total records.{{components.pagination1.totalPages}}
isVisibleWhether the component is visible.{{components.pagination1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.pagination1.isLoading}}
isDisabledWhether the component is disabled.{{components.pagination1.isDisabled}}

Styles​

Style
Default
Page text colorTheme: Primary text
Hover backgroundTheme: Surface 3
Current page backgroundTheme: Brand primary
Current page text colorTheme: Brand primary
Current page border colorTheme: Brand primary
Button radius—
Alignmentleft
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.