Pagination
Importβ
import { Pagination } from '@resultadosdigitais/tangram-components'
Propertiesβ
pageSize
πβ
total
πβ
currentPage
β
Type | number |
---|---|
Default | 1 |
Descriptionβ
Sets current page. Starts from 1.
If receive a negative number, the value will be the first page (1).
If receive a number bigger than the number of pages, the value will be the last page available.
onChange
β
Type | func |
---|---|
Param | event React.SyntheticEvent - The event source of the callback. |
Param | page number - The number of current page. |
Param | infos object - Additional information about component status. |
Descriptionβ
Callback fired when the pagination changes.
renderSummary
β
Type | string | func |
---|---|
Param | args object - Object with information available for rendering the summary in case the attribute value is a function. |
Descriptionβ
Sets the content shown as a summary next to the navigation.
// Can be a string:
renderSummary="Showing {pageSize} of {total} itens"
// Or a function:
renderSummary={({ total, PageSizeSelect }) => <>Showing <PageSizeSelect /> of {total} itens</>}
pageSizeSelectOptions
β
Type | arrayOf(number) |
---|---|
Default | [10, 20, 50, 100] |
Descriptionβ
Sets all options displayed by the PageSizeSelect
component.
pageSizeSelectLabel
β
Type | string |
---|---|
Default | Pagination.translations.en.pageSize |
Descriptionβ
Custom text for the label that identifies the page size select. This text is not displayed on the screen.
Preset values for English, Brazilian Portuguese and Spanish are available
in Pagination.translations.en.pageSize
,
Pagination.translations.ptBR.pageSize
and
Pagination.translations.es.pageSize
.
nextLabel
β
Type | string |
---|---|
Default | Pagination.translations.en.next |
Descriptionβ
Sets label for go to next button.
Preset values for English, Brazilian Portuguese and Spanish are available
in Pagination.translations.en.next
,
Pagination.translations.ptBR.next
and
Pagination.translations.es.next
.
previousLabel
β
Type | string |
---|---|
Default | Pagination.translations.en.previous |
Descriptionβ
Sets label for go to previous button.
Preset values for English, Brazilian Portuguese and Spanish are available
in Pagination.translations.en.previous
,
Pagination.translations.ptBR.previous
and
Pagination.translations.es.previous
.
hideNavigation
β
nextButtonLabel
ποΈβ
Concerns | ποΈ Deprecated: Replace by `nextLabel` property. |
---|---|
Type | string |
Descriptionβ
Sets label for go to next button.
onChangePage
ποΈβ
Concerns | ποΈ Deprecated: Replace by `onChange` property. |
---|---|
Type | func |
Descriptionβ
Callback fired when the pagination changes.
prevButtonLabel
ποΈβ
Concerns | ποΈ Deprecated: Replace by `previousLabel` property. |
---|---|
Type | string |
Descriptionβ
Sets label for go to previous button.
rowsPerPage
ποΈβ
Concerns | ποΈ Deprecated: Replace by `pageSize` property. |
---|---|
Type | number |
Descriptionβ
Sets the number of items per page.
totalRows
ποΈβ
Concerns | ποΈ Deprecated: Replace by `total` property. |
---|---|
Type | number |
Descriptionβ
Sets the total of items.