Server-Ready Orders Table With Status Badges
The default shape of an admin home screen: sortable columns, a debounced search, and pagination with a result count. Built on TanStack Table so switching to server-side data later is a data-source swap, not a rewrite.
Build an orders data table with TanStack Table, React and Tailwind. Columns: checkbox, Order ID in mono font, Customer with a small avatar, Status rendered as a tinted badge from this fixed set — paid in emerald, processing in amber, refunded in rose — Total right-aligned in tabular numerals, and Created date sorted descending by default. Header clicks toggle sort direction with an arrow glyph on the active column only. Above the table, a search input filters globally with a 250ms debounce and a status select narrows further; both write to the URL query string so views are shareable. Paginate 25 per page with Previous and Next, a page-size select, and "Showing 26–50 of 143" text between them. Keep the header sticky within the card and the first column pinned during horizontal scroll on narrow screens.




