> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/writer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/writer/8.1.2/api-reference/uicomponents/uipagination.md).

# UIPagination

Pagination component

**Since**: 6.0.0 (3.12.0)

| Name         | Type       | Description                                                         |
| ------------ | ---------- | ------------------------------------------------------------------- |
| 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

```js
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}`)
            }
        })
    )
}
```
