The perfect app has no loading states.

Pretty early on, when I was learning how to write code, I was faced with the question of how to show and implement loading states. Over the years, and especially since the shift to agentic coding, this has become a daily concern.

Agents love them. A simple spinner - done. Is it really that easy though?

There is this amazing article, "The best loading states are no loading states", which I took as inspiration to elaborate further. I'm convinced that more than one solution can be correct, but if done incorrectly, loading states will feel broken.

One thing becomes pretty clear: the first visit is the one loading state you can't get around. Dynamic content has to come from somewhere, either the server puts it into the first paint (which many do on public facing sites for SEO) or the client fetches it right after. Fine. The interesting part is everything after that - a perfect app makes the most of that first visit and then never makes you wait again.

Once a user is on the page, many sites still show spinners or skeletons. What to do then?

1. Prefetch and cache content

You can prefetch content not only in the moment a route switch happens, but already while the user is hovering or focusing a link.

From the moment a cursor lands on an interactive element, there is a natural pause of around 0.3 to 0.5 seconds before the click.1 That's enough time to prefetch most data on an average wifi connection.


The click afterwards will feel like the content was already there:



2. Custom loading states should feel fast

This one is very important. Loading states shouldn't feel smooth, slow or relaxing. They need to feel extremely fast. Users should get the impression that the app is working really hard to show content ASAP.

One thing that keeps users from using the app right away is a root-level loading state (which in some cases is the better choice) that also blocks them from navigating. The navigation is static, so it can be there from the first frame.

Create a free website with Framer, the website builder loved by startups, designers and agencies.