Your data table reuses one spinner and 'No data'. What breaks?
Question
A B2B Invoices table shows one full-page spinner while loading and plain No data whenever rows are empty. An audit of 1,000 sessions found four distinct failures:
| Scenario | Sessions | What happens today |
|---|---|---|
| First-time empty workspace | 250 | Sees No data, no CTA; 68% (170) bounce without creating an invoice |
Zero filter results (3 active filters) | 300 | Sees No data, active filters hidden; 45% (135) reload the page |
Slow API load (1.8 s on 3G) | 350 | Spinner collapses 480 px table to 80 px; CLS hits 0.34 |
Partial API 503 (KPI cards still work) | 100 | Shows No data; reload wipes all 3 filters |
Design distinct UX and frontend rules for each of the four states.
Show hints (3)
- "SPLIT TWO EMPTY STATES"
A brand-new workspace needs onboarding and a primary action. A zero-results search needs active filter feedback and a fast reset.
- "STOP LAYOUT SHIFT"
Google's good CLS threshold is
0.1(0.34is poor). How does a fixed-height skeleton prevent the400 pxheight jump? - "SCOPE PARTIAL FAILURES"
An HTTP
503is not empty data. Keep working KPI cards visible, announce the failure withrole="alert", and retry without wiping filters.
Show checked explanation
Never collapse four system states into one spinner and No data. Give first-run users a primary CTA or a starter template, and give zero-result filters active filter feedback with one-click Reset filters. Use fixed-height skeletons (480 px, aria-busy="true") to keep CLS near 0, and show a scoped role="alert" retry on 503 that keeps active filters.
Session totals, bounce and reload percentages, CLS threshold comparisons, and HTML/ARIA state markup were parsed and checked on CPython 3.12.10; official NN/g, web.dev, and MDN links were checked. Checked by an editor other than the author.
Walkthrough
Each of the 1,000 audited sessions represents a different user intent and system cause. Reusing No data hides why the table is blank. Meanwhile, an un-sized spinner causes a 400 px jump (480 px down to 80 px), pushing Cumulative Layout Shift (CLS) to 0.34. That sits well past Google's 0.1 good limit and 0.25 poor threshold.
| State | Failure today | Concrete UX and frontend rule |
|---|---|---|
First-time empty (250) | 68% (170) bounce on No data | Explain what appears here, show one primary Create invoice CTA and optional sample rows |
Zero results (300) | 45% (135) reload whole page | Show the 3 active filters clearly and add a one-click Reset filters button |
Slow load (350) | 400 px jump, CLS 0.34 | Render fixed-height skeleton rows (480 px) matching final geometry (CLS <= 0.1); set aria-busy="true" |
Partial 503 (100) | Looks like deleted billing data | Keep loaded KPI cards visible, render inline role="alert" copy and Retry preserving filters |
Keep geometry and ARIA state clean in markup:
<p class="sr-only" role="status">Loading invoices</p>
<section id="invoices-panel" aria-busy="true" aria-label="Invoices"
style="min-height:480px">
<div class="skeleton-row" aria-hidden="true"></div>
</section>
<div id="invoices-error">
<p role="alert">Could not load invoices. Your 3 active filters are kept.</p>
<button type="button" data-action="retry-invoices">Retry</button>
</div>Why each rule matters. First-time users need a clear starting path (Create invoice), whereas filtered users already have data and just need one click to widen their query. Skeleton placeholders reserve the exact 480 px box so footers and pagination stay put during the 1.8 s fetch. Keep role="status" outside the aria-busy="true" region so assistive tech announces loading right away, and place role="alert" on the error text rather than wrapping the interactive Retry button. Finally, distinguishing an HTTP 503 error from an empty array prevents billing teams from panicking over "missing" invoices and lets them retry in place without losing their 3 filters.
Common mistakes
- Showing
No datawhen an API request fails with503. Users cannot tell a network outage from deleted records and lose trust fast. - Rendering a full-page spinner that hides already loaded KPI cards and collapses the
480 pxtable to80 px, driving CLS past0.25. - Treating first-time empty workspaces the same as zero filter results. New users need a creation CTA, while filtered users need a Reset filters button.
- Nesting
role="status"insidearia-busy="true"or putting a Retry button insiderole="alert". Keep live status outside busy regions and limitrole="alert"to error text.
Follow-up questions
- "When should you show a skeleton screen versus a tiny inline spinner or nothing at all?" For loads under
300 ms, avoid flashing a skeleton at all because brief flicker feels slower. Use geometry-matched skeletons for300 msto a few seconds (like this1.8 stable fetch), and pair longer waits (> 10 s) with clear progress text or a cancel action. - "How do you keep a user's 3 active filters safe even if they DO press browser reload?" Sync active filter selections into URL query parameters (such as
?status=overdue®ion=eu&tier=pro) instead of keeping them only in React memory. Then reloading, sharing a link, or retrying after a503restores the exact same query.
What a strong answer covers
Separates all four states cleanly: first-run CTA, zero-results active filter summary with reset, 480 px fixed-height skeleton fixing CLS 0.34 toward 0, and scoped role="alert" retry on 503 that preserves filters.
Open in interactive practice deck →