FrontendInterviews.dev

Loading problem…

128. Data Table - Pagination

Medium•
Acceptance: 68.00%
•
🔓3/3 Pro unlocks today

This problem builds on data-table. Complete that first, then load your solution to continue.

Build an enhanced Data Table component that extends the base Data Table with pagination functionality. This builds on top of the sorting feature from the base Data Table.

Requirements

1. Pagination

  • Configurable items per page (10, 25, 50, 100)
  • Page navigation (first, previous, next, last)
  • Display current page and total pages
  • Show total number of items

Examples

Example 1:

Input: Change page size to 25
Output: Table displays 25 items per page
Explanation:
Pagination updates based on new page size

Example 2:

Input: Click next page button
Output: Table displays next set of results
Explanation:
Pagination navigates through data

Constraints

  • Pagination should work with filtered/sorted data
  • Reset to page 1 when filters or sorting change