UIPagination

Pagination component

Since: 6.0.0 (3.12.0)

NameTypeDescription

currentPage

int

Required - Current page number, not zero-indexed

totalPages

int

Required - Number of total pages

onPageChange

function

Required - Callback function fires when current page is changed

Example

import {UIPagination} from 'writer'

render($$) {
    const el = $$('div')
    return el.append(
        $$(UIPagination, {
            currentPage: 1,
            totalPages: 10,
            onPageChange: (pageNumber) => {
                console.info(`You are now on page ${pageNumber}`)
            }
        })
    )
}

Last updated