Skip to main content
K
Last modified: 24/Jun/2024

Paginator

Pagination controls provide swift access to all pages while indicating that more pages exist.

#Usage

import { Paginator } from '@kinsta/stratus' const MyComponent = () => ( <Paginator totalCount={500} itemsPerPage={50} /> )

#Props

#currentPage
Required
number
The current page.
#totalCount
Required
number
The total number of rows.
#itemsPerPage
number
Rows displayed per paginated page.
50
#prevLabel
string | number | ReactElement<any, string | JSXElementConstructor<any>>
Custom label of the "Previous" button
<Translation path="prevPage" />
#nextLabel
string | number | ReactElement<any, string | JSXElementConstructor<any>>
Custom label of the "Next" button
<Translation path="nextPage" />
#skipPagesLabel
string | number | ReactElement<any, string | JSXElementConstructor<any>>
Custom label of the "Skip n pages" button
( <Translation path="skipPages" args={{ count: SKIP_PAGES }} /> )
#onChange
(MouseEventHandler<HTMLLIElement> | KeyboardEventHandler<HTMLLIElement>) & FormEventHandler<HTMLUListElement>
Invokes a function when a different page is clicked
#onPageChange
Required
(page: number) => void
Invokes a function when a different page is clicked passing the page number as a param
#type
ButtonTypes
Sets the type of the component
#icon
"AnalyticsAlt" | "AnalyticsCircleAlt" | "AnalyticsCircleSolidAlt" | "AnalyticsCircleSolid" | "AnalyticsCircle" | "AnalyticsSmall" | "AnalyticsSquareAlt" | "AnalyticsSquareSolidAlt" | ... 525 more ... | "Wrench"
Adds an icon to the button
#iconPosition
IconPosition
Positions the icon before or after the button text
#htmlType
"button" | "submit" | "reset"
Indicates the behavior of the button
#isDisabled
boolean
Sets the disabled state of button
#isLoading
boolean
Sets the loading status of button
#tooltip
TooltipType
Adds a Tooltip component around the button. Required if isDisabled is true
#ariaLabel
string
ARIA label of the button. Required if tooltip is not provided
#href
string
If href is passed button will act as a link
#title
string
The title of the link
#target
"_blank" | "_self" | "_parent" | "_top"
#rel
"noopener" | "noreferrer" | "noopener noreferrer"

#Types

  • PaginatorProps: props of the Paginator component processed by stratus
  • PaginatorInterface: PaginatorProps & ButtonProps extended by HTMLAttributes<HTMLUListElement>

Read more about types here