Examples
Order management
Built with the mantine-data-grid skill
Build the orders table of a shop admin panel. The data comes from a server: sorting, filtering and pagination happen on the server, never on the client.
Data:
- a mock API module with about 2,000 generated orders (number, customer name and email, status: pending, paid, shipped, refunded or cancelled, number of items, total, created date within the last 6 months)
- the API takes page, page size, sort, status filter, created date range and a search query, and returns one page of rows with the total count and the count of orders per status for the current filters
- every request waits 300–900 ms; about one request in fifteen fails
Table:
- columns: order number, customer (name with email under it), status, items, total, created date; total and items are right-aligned
- sortable by order number, total and created date
- a search field (order number, customer name or email), a status filter that shows the number of orders for each status, and a created date range filter
- active filters show as chips above the table; each chip removes its filter, and "Clear all" removes all of them
- search, filters, sort, page and page size are kept in the URL, so reloading or sharing the link shows the same view
- changing a filter, the search or the page size goes back to the first page
- while a page loads, the previous rows stay visible with a loading indicator; a failed request shows an error with a "Retry" button; no results show an empty state with a way to clear filters
Selection:
- rows can be selected across pages; the selection survives page changes and is cleared when filters change
- with a selection, a bar shows how many orders are selected with "Mark as shipped" and "Refund" actions; both ask for confirmation with the number of orders, only apply to orders whose status allows it, and say how many were skipped
- after an action, the current page reloads
The component is shown on a demo page that already has a title: do not add a page title or intro text.
Write tests for the component.