Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Web

Pagination

The Pagination component provides pagination with page navigation, next and previous links. The pagination is generated dynamically using query params: ?page=1

Usage

import { Pagination } from 'components/lib';

function MyComponent({ ...props }){

  return (
    <div>
      <Pagination total={ 5 } limit={ 25 } className={ Style.pagination }/>
    </div>
  );
}

Props

PropDescriptionRequiredValue
childrenchild components as per Shadcn docs if not using total and limit propsoptionalcomponent(s)
classNamecustom stylesoptionalSCSS or Tailwind
totalthe total number of items in the listrequiredinteger
limitthe number of items per pagerequiredinteger

Notes

  • The Pagination component uses various sub-components like PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, and PaginationEllipsis.
  • The total prop specifies the total number of items in the list
  • The limit prop determines how many items to show per page
  • The className prop allows for custom styling to be applied.
  • If items is not provided, the children prop can be used to pass custom child components.
  • For more details, refer to the Shadcn Pagination documentation.