Layout · 11 of 23

Skeleton Load

Shimmer loading state

HTML · CSS · No dependencies · MIT

HTML

<div class="skeleton-card loading">
  <div class="sk-img"></div>
  <div class="sk-line w-80"></div>
  <div class="sk-line w-60"></div>
</div>

CSS

.skeleton-card {
  width: 100%;
  max-width: 320px;
}

.sk-img {
  width: 100%;
  height: 100px;
  background: #222;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.sk-line {
  height: 12px;
  background: #222;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.w-80 { width: 80%; }
.w-60 { width: 60%; }

/* A moving gradient highlight creates the shimmer.
   Remove the .loading class when real content arrives. */
.skeleton-card.loading .sk-img,
.skeleton-card.loading .sk-line {
  background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}