Switch to infinite scroll (Full book)

Pagination

The Pagination widget is a macro component built from multiple parts.

required props

  • the total number of pages
  • the value of the cursor aka selected page number.
  • the onChange handler, which receives the tentative page number:
const [activePage, setActivePage] = useState<number>(1)
//
<Pagination total={10} value={activePage} onChange={setActivePage} />

other props

  • withControls, to show previous and next arrows, defaults to true.
  • withEdges, to show "first page" and "last page" arrows, default to false.
  • size, to get bigger or smaller pagination control, defaults to md
  • radius, to get rounder or squarer controls, defaults to md
earlymorning logo

Pagination

The Pagination widget is a macro component built from multiple parts.

required props

  • the total number of pages
  • the value of the cursor aka selected page number.
  • the onChange handler, which receives the tentative page number:
const [activePage, setActivePage] = useState<number>(1)
//
<Pagination total={10} value={activePage} onChange={setActivePage} />

other props

  • withControls, to show previous and next arrows, defaults to true.
  • withEdges, to show "first page" and "last page" arrows, default to false.
  • size, to get bigger or smaller pagination control, defaults to md
  • radius, to get rounder or squarer controls, defaults to md