Build series · Interface design
Designing loaders.
Until 1 December, every screen in RepGarden’s prototype appeared the moment you opened it, because its data never had to travel. Then I designed what happens on a real connection: how each screen loads, what it does when something fails, how a change is saved, and two loaders of RepGarden’s own.
By Ahmed Gadir12 min read
A prototype that never waited
RepGarden is the app for personal trainers and their clients that I’m building in public: trainers work from a web app, and clients log their workouts on a phone and grow a vegetable farm as they train. It’s being designed in a prototype, a version of the app in a web page that runs on sample data. None of the real app is built yet.
The sample data lives in the page, so nothing in the prototype ever had to come over the internet, and nothing could be slow or fail. The real app won’t be like that. The trainer’s home page alone is built from eight parts, such as who trained, who’s behind on their plan and the clips waiting for a reply. Each one comes from the server on its own, some faster than others, and any of them can fail.
So I added a loading demo to that page. A stand-in server answers each part after its own delay, a Slow setting makes everything two and a half times slower, and a switch makes any part fail. The page plays two ways: a Before built for the comparison, with mistakes real apps still make, and an After with the fixes.
Each section loads on its own
In the Before, one big spinner means the whole page has to wait for its slowest part: two seconds normally, five on Slow. Then everything appears at once.
In the After, the page’s frame shows straight away: the sidebar, the greeting, every heading and every panel. Each part then fills in as soon as its own data arrives, so the fast ones come first. Until then, each part shows a skeleton where its content goes: a grey outline of what’s coming, with circles where the pictures will be and bars where the lines of text will be, in the same rows, shapes and heights as the real thing.
A skeleton may not make the wait feel any shorter. Nielsen Norman Group, a user-experience research firm, says it does,[1] but a 2017 test by the agency Viget found that people shown a skeleton thought they had waited longer than people shown a spinner or a blank screen.[2] What it certainly does is show you the page you’re about to get, and let every part arrive as soon as it’s ready.
Two timings stop the skeletons flashing. A part that answers within 200 milliseconds never shows one, and a skeleton that does appear stays for at least 400 milliseconds, so it doesn’t flicker. Guidance on the first number varies: GitLab waits a tenth of a second before it draws a spinner,[3] Nielsen Norman Group says a wait of under a second needs no special feedback,[4] and Google’s Material Design shows nothing for the first 200 milliseconds,[5] the same line RepGarden uses. Vercel’s guidelines keep a loader up for about 300 to 500 milliseconds once it appears.[6] A part still loading after three and a half seconds says it’s taking longer than usual.
Nothing moves when a section fills
In the Before, parts of the page grow after it appears, with no space kept for them. Half a second in, Behind on their plan gets the workouts still open, so that card grows taller and pushes the cards under it down. At a second, the last two clips arrive and push the next section down. At a second and a half, the four number tiles get their detail lines and change width, because each tile is as wide as its text. That’s layout shift: the page moving as things load. It’s jarring when you’re reading, and worse when you’re about to tap. Google’s own example is someone who confirms a large order they meant to cancel, because the page moved under their finger.[7]
In the After, each section gets a fixed space, so nothing jumps around. Each skeleton draws as many rows as its part had last time, and each skeleton row is as tall as a typical row of that part, measured on the sample data at three screen widths: 1440, 1024 and 390 pixels. So a part keeps its height when it fills.
That’s exact for the sample data and only close for anything else: other content, or a screen width other than those three, would still move the page a little when a part fills. And a kept space works best as a minimum height that the section can grow past, because a fixed height cuts off content that turns out longer than planned, such as a translation or a page someone has zoomed in on.[8]
Google scores layout shift as Cumulative Layout Shift, which its PageSpeed Insights report shows for any public page: 0.1 or less is good, and above 0.25 is poor.[7] When Yahoo! JAPAN News reserved space for the picture at the top of each article, its score improved by 0.2 and people read 15% more pages per visit, though the team reports the two together, not that one caused the other.[9]
A failure stays in its section
In the Before, one refused request fails the whole page: “Something went wrong”, with no Retry and nothing else shown, even after the page has appeared. One part fails differently: when the lines for your information are refused, the page shows nothing, and that looks the same as having nothing new.
In the After, a part that fails shows an error just in that part, with a Retry button, and the rest of the page keeps working. The failed part is never left white: a soft grey fills the whole height it had kept, so nothing moves. A tall part, like the clips, shows a crossed-out cloud in the middle, “Couldn’t load the clips”, “The rest of Home works.” and Retry. A short part says the same in one row. The four number tiles come from one request, so they fail together, as one grey strip with one Retry, rather than tile by tile. If Retry fails too, the message becomes “Still couldn’t load the clips” and suggests trying again in a minute.
The words say what didn’t load, plainly. An error code tells people nothing, and Apple’s writing guidelines warn that words like “oops” can sound insincere.[10] A failed part never shows an empty state such as “No clips yet” either. Nielsen Norman Group calls a “No records” message that later fills with data particularly harmful, because people can’t tell whether the app is still working or has broken.[11]
TanStack Query does the retrying
The Before loads its data with requests written by hand. The After uses TanStack Query, a free library (ready-made code an app can use) for loading data, which RepGarden’s technical design proposes for the real web app. Each part of the home page is its own query, TanStack’s word for one piece of data it fetches and keeps, and two things TanStack Query does by default shaped the design:
- TanStack Query retries a failed request. It tries three more times, waiting one second, then two, then four, and reports the error only after the last try fails.[12] A request that failed because of a blip in the connection can come through on a later try without anyone seeing an error.
- TanStack Query refreshes your data when you come back to the tab.[13] In RepGarden, the data on screen stays where it is, with a small “Refreshing” note beside each heading, while the new data loads in the background. Coming back to the home page from another page works the same way: the last data shows at once, and the page never goes back to skeletons.
The first After showed “Retrying…” in a part while it tried again. I took it off. It wasn’t telling anyone anything they needed, and retrying is something that should happen in the background, so a part now keeps its skeleton through every try and shows the error only when the last one has failed.
With no connection, every part keeps its data with “Offline” beside its heading, and a change made meanwhile waits until the connection comes back. If an AI tool is building your app, you can ask it to load the data with TanStack Query, with a separate query for each section of the page.
A change shows before the server answers
The home page has two buttons that change something: Got it, which clears a line under For your information, and Send again, which resends an invite that ran out. In the Before, both show nothing for a second and a half while they wait for the server, then the page jumps. A double press on Send again sends two invites. A change the server refuses says nothing at all.
In the After, both are optimistic updates: the change shows right away, as if the save has already worked, and is saved in the background. Got it clears the line at once, with Undo. Send again shows the new invite in its row at once, with a small loader and “Sending…” inside the button, which keeps its width and is locked, so a double press sends one invite. If a save fails, the old version comes back and says so in its own row: “This line wasn’t cleared” or “Not sent”.[6] No failure is reported in a message that disappears by itself.
Optimistic updates suit changes that almost always work and cost little if they don’t. Duolingo predicts many results in its app before its server confirms them, but waits for the server when people buy gems or are promoted on a leaderboard. Its rule: “If the user cares deeply or if the value affects monetization or fairness, wait for backend confirmation.”[14] RepGarden’s client app splits its saves the same way. A switch, the units, the goal and the body for the body map change at once and are sent behind them, and a refusal puts them back and says so in place. Pausing the plan, resuming it and changing your picture or name wait for RepGarden: the button shows a small loader and is locked, and a refusal leaves everything as it was, with “Not saved. RepGarden didn’t answer, so nothing has changed. Try again in a moment.” Paying waits too, on a button that says “Opening Stripe’s page…”.
On the phone, logging never waits
The client app’s prototype got the same treatment the same day, with a Network setting of its own: Instant, Normal, Slow, Flaky (every request fails once and works on a silent retry), Failing and Offline. It follows the same rules as the web app, with a few differences:
- The first load shows each region as a block in its own tint, held still, with no grey bars. Today shows a loader over the whole area and “Fetching your week from Benji”. Afterwards, a tab opens on what the phone already holds and refreshes behind it.
- A failure shows Mr Patata’s broken-down truck on a grey ground, with “Your past workouts didn’t load”, “RepGarden didn’t answer. Nothing of yours is lost.” and Try again.
- No signal puts one line under each tab’s title saying what still works. A part that never loaded says it will load when you’re back online, with nothing to press.
The workout never waits on the network. Every set, weigh-in and check-in is kept on the phone first and sent when it can. With no signal, a line under the workout’s title counts the sets kept on the phone, a set not sent yet says so on its row, and the finish screen says the workout is saved on this phone. When the signal comes back, the marks go, with one quiet toast.


Loaders of RepGarden’s own
One loader doesn’t suit every wait, so RepGarden uses four kinds:
- A skeleton for content whose shape is known, like the parts of the home page.
- A loading mask for an area that refreshes in place. In the After, sorting or searching the clients table keeps the old rows where they are, dimmed, with “Loading your clients” over them, until the new rows arrive.
- An inline loader inside a button that’s working, with a word for what it’s doing: “Sending…”, “Saving…”, “Opening Stripe’s page…”. The button keeps its width and is locked.
- A progress bar for a long wait, or one that can be measured, such as an upload’s percentage or onboarding’s step bar. Guidance on when a wait is long enough for one varies: Material Design switches after five seconds,[5] and Nielsen Norman Group after ten.[1]
Until the same day, the loaders themselves were plain grey rings. I replaced them with two of RepGarden’s own, which both prototypes now use. The inline loader is a carrot hopping or a seed sprouting. The mask loader is either of those, a watering can or three vegetables. Each picks its drawing at random when a load starts and keeps it until that load ends. When the phone or computer asks for reduced motion, nothing moves, but each loader fades slowly, so it never looks stalled. The grey ring is retired; only the Before keeps one, as the fault it shows.
Where things stand
All of this is the prototype’s design, running on sample data with a stand-in server. None of the real app is built yet, and TanStack Query is a proposal in the technical design, not a settled choice. In the web app’s demo, only Got it and Send again talk to the stand-in server, and each part of the home page is one request, so it fails whole; a part that could load some rows and not others would show the ones it has, with the failure where the rest would be.
I don’t know yet how these timings feel on a real network, or how a screen reader reads the announcements. The prototype’s checks can’t show either, so they’re the first things to test once there’s a real app to test them on.
The same rules are a free skill for Claude Code, loading states: point it at your own app and it checks every screen that loads or saves against them, shows you a plan, and makes only the changes you agree to.
RepGarden has its own website with a waiting list, at repgarden.app.
Sources
Nielsen Norman Group — Skeleton Screens 101, 2023. Says a skeleton reduces the perceived loading time and does not replace work on performance; recommends a skeleton for full-page waits under 10 seconds and a progress bar for anything longer. Tankala, Nielsen Norman Group.
Viget — A Bone to Pick with Skeleton Screens, 2017. A test of the same wait behind a spinner, a skeleton and a blank screen; the skeleton group rated its wait the longest. Viget’s article.
GitLab Pajamas — Spinner. GitLab’s design system delays drawing a spinner by 100 milliseconds. The spinner guidelines.
Nielsen Norman Group — Response Times: The 3 Important Limits. Delays between a tenth of a second and a second normally need no special feedback; over a second, show that the computer is working. Nielsen, Nielsen Norman Group.
Material Design 3 — Progress indicators. Google’s design system shows no indicator for waits under 200 milliseconds, a loading indicator up to 5 seconds and a progress indicator after that. The guidelines.
Vercel — Web Interface Guidelines. A loader gets a short delay before it shows and “a minimum visible time (~300–500 ms)” once it does; optimistic updates are for when success is likely, and on failure “show an error & roll back or provide Undo”. The guidelines.
web.dev — Cumulative Layout Shift (CLS). Good values are 0.1 or less and poor values greater than 0.25; its example of the harm is a shift that “makes the user confirm a large order they intended to cancel”. Google’s web.dev.
Shopify — migrating from SkeletonBodyText. Keep a section in place while it loads, but avoid a fixed height that clips translated or zoomed content once it arrives. Shopify’s developer documentation.
web.dev — Yahoo! JAPAN News case study. Reserving space for each article’s top image improved the CLS score by 0.2, alongside 15% more page views per session, which the team reports as a correlation. The case study.
Apple Human Interface Guidelines — Writing. “Interjections like ‘oops!’ or ‘uh-oh’ are typically unnecessary and can sound insincere.” The guidelines.
Nielsen Norman Group — Designing Empty States in Complex Applications, 2021. A “No records” message that later fills with data leaves people unsure whether the system is still working or has failed. Kaplan, Nielsen Norman Group.
TanStack Query — Query retries. A failed query is retried 3 times by default in the browser, waiting 1 second and doubling each time up to 30 seconds, and the error is shown after the last attempt. TanStack Query’s documentation.
TanStack Query — Important defaults. Data counts as stale straight away, and stale data is refetched in the background when, among other things, the window is refocused. TanStack Query’s documentation.
Duolingo — Seeing the future: frontend prediction in Duolingo’s mobile app, 2026. Xuanji Li on predicting results in the app, and the cases, such as buying gems and leaderboard promotions, where it waits for the server. Duolingo’s blog.