Skip to content
NavigationInteractive playground

Pagination

Navigate paginated result sets.

Preparing the playground…
Text and Markdown example
Pagination · Example
1function Example() { 2 const [page, setPage] = useState(1); 3 return <Pagination><PaginationContent>{[1,2,3].map(value => <PaginationItem key={value}><PaginationLink href="#" isActive={page === value} onClick={event => {event.preventDefault();setPage(value)}}>{value}</PaginationLink></PaginationItem>)}</PaginationContent></Pagination>; 4}
Read documentation in Markdown

How to use it

Keep page state in your application and connect events. Mark the current link with isActive.

Import

React / Next.js
1import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationButton, PaginationPrevious, PaginationNext, PaginationEllipsis } from "@kivora/nextjs";

Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.

API reference 0.2.0

Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.

PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
onChangeChangeEventHandler<HTMLElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.

Subcomponents and composition

Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.

Pagination13 properties
Pagination · TypeScript
1Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>
PaginationContent13 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
onChangeChangeEventHandler<HTMLUListElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLUListElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLUListElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
PaginationContent · TypeScript
1PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>
PaginationItem14 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
onChangeChangeEventHandler<HTMLLIElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLLIElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLLIElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
valuestring | number | readonly string[]Controlled value. Update it from the change callback.
PaginationItem · TypeScript
1PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>
PaginationLink15 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
isActivebooleanConfigures isActive. The type describes the supported values and structure.
onChangeChangeEventHandler<HTMLAnchorElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLAnchorElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLAnchorElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
typestringOperation type or mode; values depend on the component.
PaginationLink · TypeScript
1PaginationLink: React.ForwardRefExoticComponent<PaginationLinkProps & React.RefAttributes<HTMLAnchorElement>>
PaginationButton18 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
disabledbooleanDisable interaction with the control.
idstringElement identifier; associates labels and descriptions.
isActivebooleanConfigures isActive. The type describes the supported values and structure.
namestringName used to identify the control in forms.
onChangeChangeEventHandler<HTMLButtonElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLButtonElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLButtonElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
type"button" | "submit" | "reset"Operation type or mode; values depend on the component.
valuestring | number | readonly string[]Controlled value. Update it from the change callback.
PaginationButton · TypeScript
1PaginationButton: React.ForwardRefExoticComponent<PaginationButtonProps & React.RefAttributes<HTMLButtonElement>>
PaginationPrevious16 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
isActivebooleanConfigures isActive. The type describes the supported values and structure.
labelstringText or accessible label.
onChangeChangeEventHandler<HTMLAnchorElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLAnchorElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLAnchorElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
typestringOperation type or mode; values depend on the component.
PaginationPrevious · TypeScript
1PaginationPrevious: React.ForwardRefExoticComponent<PaginationPreviousProps & React.RefAttributes<HTMLAnchorElement>>
PaginationNext16 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
isActivebooleanConfigures isActive. The type describes the supported values and structure.
labelstringText or accessible label.
onChangeChangeEventHandler<HTMLAnchorElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLAnchorElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLAnchorElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
typestringOperation type or mode; values depend on the component.
PaginationNext · TypeScript
1PaginationNext: React.ForwardRefExoticComponent<PaginationNextProps & React.RefAttributes<HTMLAnchorElement>>
PaginationEllipsis13 properties
PropertyTypeDescription
aria-labelstringAccessible name of the control.
childrenReactNodeContent or child elements of the component.
classNamestringAdditional CSS classes to customize the element.
defaultCheckedbooleanInitial selection of the control.
defaultValuestring | number | readonly string[]Initial value when the component manages its own state.
idstringElement identifier; associates labels and descriptions.
onChangeChangeEventHandler<HTMLSpanElement, Element>Change event. Check the type: some controls return an object, others a DOM event.
onClickMouseEventHandler<HTMLSpanElement>Action performed when the element is activated.
onSubmitSubmitEventHandler<HTMLSpanElement>Form submission event.
roleAriaRoleSemantic role of the element. Keep the default role unless a change is justified.
styleCSSPropertiesReact inline styles.
tabIndexnumberKeyboard focus order and availability.
titlestringTitle or supplementary information.
PaginationEllipsis · TypeScript
1PaginationEllipsis: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>
API generated from @kivora/nextjs 0.2.0View package