A loading screen is what a visitor sees while your shop loads: a cover in your colours, usually with your logo, that leaves when the page is ready. Designers call it a preloader; you will also see splash screen and intro animation. They are the same thing. Shopify themes do not ship with one, so there are three ways to get it.
1. A snippet in the theme
If you are comfortable in the code editor, a basic loading screen is about twenty lines. In your admin, open Online Store, Themes, Edit code, then layout/theme.liquid, and paste this straight after the opening <body> tag:
<div id="loader" aria-hidden="true">
<img src="{{ settings.logo | image_url: width: 320 }}" alt="" width="160">
</div>
<noscript><style>#loader { display: none; }</style></noscript>
<style>
#loader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: #fff; transition: opacity 0.4s; }
#loader.done { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #loader { display: none; } }
</style>
<script>
(function () {
var loader = document.getElementById('loader');
function done() { loader.classList.add('done'); }
if (sessionStorage.getItem('loaderSeen')) { loader.style.display = 'none'; return; }
sessionStorage.setItem('loaderSeen', '1');
window.addEventListener('load', done);
setTimeout(done, 4000);
})();
</script>
What each part is for:
- The cover sits on top of the page. The page itself is never hidden, so it keeps loading underneath and search engines read it as before.
- It plays once a visit. The note in
sessionStoragemeans a click from the home page to a product does not show it again. - It leaves when the page is ready, or after four seconds, whichever comes first, so one slow image can never trap a visitor behind it.
- Reduced motion and no JavaScript are covered. Visitors who ask their device for less motion never see it, and a browser without scripts is not left staring at a cover.
settings.logo is the logo setting in Dawn and the themes built on it. If nothing shows, look up the name of your theme’s logo setting in config/settings_schema.json.
What you get is a white screen with your logo that fades. It is honest work, and it is yours to maintain: when the theme is updated, edited files are not updated for you, and the snippet has to be carried over to the new version.
2. A GIF or a ready-made spinner
The next step up is to swap the logo for an animated GIF, or to pick a spinner from a list. It moves, and it takes no design work. The cost is in what it says and what it weighs. A spinner tells a visitor to wait, in the same shape they have seen on a thousand other sites. A GIF is the heaviest way to move a logo, and it is fetched ahead of the page it is covering.
3. An app embed
An app embed runs inside the theme without editing it: you switch it on in the theme editor under App embeds, and switch it off the same way. Segue has nine loading screens, each one a short piece of motion built from your own logo and your words, in your theme’s colours or three of your own. It plays when a visit starts, never between pages, and it leaves when the page is ready.
Five mistakes that make a loading screen feel slow
- Playing on every page. A loading screen greets a visit. On every click it turns a fast shop into a slow one.
- A fixed length. Three seconds on a page that was ready in one is two seconds stolen. It should leave when the page is ready.
- Hiding the page instead of covering it. Setting the whole page to invisible until a script reveals it means a blank shop whenever that script is late.
- Ignoring reduced motion. Some visitors ask their device for less motion. They should get none.
- A heavy file in front of the page. A video or a large GIF competes with your own hero image for the first second of the connection.
Which one to choose
The snippet, if a plain cover is all you want and you are happy to look after it. An app, if you want the motion designed and made from your logo. There is more on what a preloader is for in the preloader guide, and on search and speed in Do preloaders hurt SEO?. Segue is on the Shopify App Store and is free to use.