Sobeys Logo

Pagination Component

This page demonstrates a fully functional, context-based Pagination system built with React, tailored for responsive layouts across desktop, iPad, and mobile views. It leverages a separation of concerns between logic and UI, making the pagination logic reusable and scalable across various content-heavy components.

Context-Based Pagination Logic

  • Uses a PaginationProvider to manage state (current page, total items, etc.) and share it with the Pagination component.
  • Keeps business logic (calculations, current page management) separate from UI.

Customizable Layouts:

  • Renders paginated content for three breakpoints:
  • Desktop max-w-[1920px]
  • iPad max-w-[768px]
  • Mobile max-w-[480px]

Desktop

Paginated Items

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • <
  • 1
  • 2
  • 3
  • 4
  • ...
  • 20
  • >

iPad

Paginated Items

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • <
  • 1
  • 2
  • 3
  • 4
  • ...
  • 20
  • >

Mobile

Paginated Items

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • <
  • 1
  • 2
  • 3
  • 4
  • ...
  • 20
  • >