Skip to main content

Pagination

TkPagination component description.

import { TkPagination } from '@takeoff-ui/react'

Playground

Preview

Generated Code

<TkPagination
type="outlined"
totalItems={100}
rowsPerPage={10}
currentPage={1}
/>
<TkPagination
type="outlined"
:totalItems="100"
:rowsPerPage="10"
:currentPage="1"
/>
<tk-pagination
type="outlined"
[totalItems]="100"
[rowsPerPage]="10"
[currentPage]="1"
/>

Controls

Basic

The basic usage of TkPagination.

View Code
<TkPagination totalItems={50} rowsPerPage={10} />

Design

grouped, outlined, and text are available.


View Code
<TkPagination totalItems={50} rowsPerPage={10} type="outlined" />

Mode

compact, compact-expanded are available.


View Code
<TkPagination totalItems={50} rowsPerPage={10} mode="compact" />

API

Props

NameTypeDefaultDescription
number1The current page of the pagination.
string'item: { startItem}-{ endItem}of{ totalItems}'Template string for items report in pagination. Available placeholders: {startItem}, {endItem}, {totalItems}
"compact", "compact-expanded"nullThe mode of the pagination
string'page: { currentPage}of{ totalPages}'Template string for current page report in pagination. Available placeholders: {currentPage}, {totalPages}
booleanfalseWhether the pagination elements should have rounded corners
number10Number of items per page.
number[][5, 10, 20, 50]Number of items per page options
number0Number of total items.
"grouped", "outlined", "text"'outlined'The type of the pagination

Events

NameDescription
tk-next-pagePagination next button click event
tk-page-changePagination page change event
tk-prev-pagePagination prev button click event
tk-rows-per-page-changeRowsPerPage change event