惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Y
Y Combinator Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
D
Docker
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
B
Blog
Vercel News
Vercel News
Recent Announcements
Recent Announcements
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
宝玉的分享
宝玉的分享

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Why Loaders Matter for Performance
Jakub Andrze · 2026-05-11 · via DEV Community

When developers think about performance optimization, they usually focus on things like:

  • lazy loading
  • caching
  • image optimization
  • bundle size

And while those things absolutely matter there’s another area that heavily impacts user experience -> Loading states and layout stability.

A badly implemented loading experience can make an app feel slow, jumpy, or frustrating to use. This is strongly connected to an important Core Web Vital metric Cumulative Layout Shift (CLS).

In this article, we’ll explore:

  • What CLS is
  • Why loaders are critical for perceived performance
  • How poor loading states hurt UX
  • Practical examples in Vue
  • Best practices for stable layouts

Let’s dive in.

🤔 What Is Cumulative Layout Shift (CLS)?

CLS measures how much elements unexpectedly move during page loading.

Example of bad CLS:

  • Text suddenly jumps down
  • Buttons move while you try to click
  • Images appear late and push content around

We’ve all experienced websites like this:

👉 You try to click something… and suddenly the layout shifts. Extremely annoying.

Why does this happen? Usually because:

  • content loads asynchronously
  • elements have no reserved space
  • loaders are missing
  • images don’t define dimensions
  • components suddenly appear

Why does CLS matter? Because it affects user experience, accessibility, or mobile usability (and obviously Google Core Web Vitals). Even if your app is technically fast poor layout stability can make it feel slow.

👉 Users care more about perceived performance than actual milliseconds.

A good loader communicates progress, prevents layout jumping, and makes apps feel responsive

A bad or missing loader creates uncertainty. Users start thinking:

  • “Did the app freeze?”
  • “Is something broken?”
  • “Why is everything moving?”

🟢 Implementing proper loaders in Vue

Let's take a look at the following example:

<script setup lang="ts">
const users = ref([])
const loading = ref(true)

onMounted(async () => {
  users.value = await fetchUsers()
  loading.value = false
})
</script>

<template>
  <div v-if="loading" class="skeleton-list">
    <div
      v-for="n in 5"
      :key="n"
      class="skeleton-card"
    />
  </div>

  <UserCard
    v-else
    v-for="user in users"
    :key="user.id"
    :user="user"
  />
</template>

<style scoped>
.skeleton-card {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 16px;
}
</style>

Enter fullscreen mode Exit fullscreen mode

We fetch users, but when the fetch is in progress we display the same hard coded number of loaders/skeletons. When the users are loaded there is no layout shift as it occupies the same space improving perceived performance and User Experience.

If we don't know how many results there will be, we have to assume some number but it is still better than not having skeletons at all :)

Many apps still use simple spinners or text/icon loaders like:

<div>Loading...</div>

Enter fullscreen mode Exit fullscreen mode

But modern UX usually prefers Skeleton loaders because they mimic final layout, reduce layout shift, and improve perceived speed.

🧪 Best Practices

  • Prefer skeleton loaders over tiny spinners
  • Reserve space before content loads
  • Keep loading and final layouts similar
  • Always define image dimensions
  • Avoid injecting large content suddenly
  • Test CLS using Lighthouse or Core Web Vitals tools
  • Think about perceived performance — not just raw speed

📖 Learn more

If you would like to learn more about Vue, Nuxt, JavaScript or other useful technologies, checkout VueSchool by clicking this link or by clicking the image below:

Vue School Link

It covers most important concepts while building modern Vue or Nuxt applications that can help you in your daily work or side projects 😉

🧪 Advance skills

A certification boosts your skills, builds credibility, and opens doors to new opportunities. Whether you're advancing your career or switching paths, it's a smart step toward success.

Check out Certificates.dev by clicking this link or by clicking the image below:

Certificates.dev Link

Invest in yourself—get certified in Vue.js, JavaScript, Nuxt, Angular, React, and more!

✅ Summary

Loaders are much more important than most developers realize.

In this article, you learned:

  • What Cumulative Layout Shift (CLS) is
  • Why poor loading states hurt UX
  • How skeleton loaders improve perceived performance
  • How to avoid layout jumping in Vue and other frameworks
  • Best practices for stable, responsive interfaces

Fast apps are great.

But apps that feel smooth and stable are what users truly remember.

Take care!
And happy coding as always 🖥️