Skip to content
Frontend live coding · 45 minutes

Data table: sort, filter, paginate

Build a data table in React in 45 minutes, with no table library. Use a local array of about 200 objects, for example users with a name, an email, an age and a city. The user can sort by a column, filter the rows with a text input, and move through pages. Start with rendering and sorting, then add the filter, then the pagination. Explain your decisions while you code, as in a live round.

Requirements

  • The rows are in a real table element with a header row
  • A click on a header sorts by that column; a second click reverses the order; the header shows the direction
  • Numbers sort as numbers and text sorts as text, and the original array is not changed
  • A text input filters the rows by a match in any column, ignoring upper and lower case
  • Pagination with 10 rows per page: Previous, Next, the current page and the number of pages
  • A change of filter or sort returns to page 1
  • When no row matches, the table shows a message

What reviewers look for

What reviewers look for, the checklist and the stretch goals opens with a year in the app. What a year includes