State & Feedback Animation — Reference
Skeleton Text Blocks
The Skeleton Text Blocks is a pure-CSS loading animation that multiple text-line shimmer placeholders arranged at varying widths to mimic paragraph content. Use for article previews, comment sections, or any text-heavy area that loads asynchronously. It requires no JavaScript, runs entirely on the GPU via CSS transforms, and communicates application state clearly without blocking the browser's main thread.
When to use the Skeleton Text Blocks
- Perceived performance improvements during page hydration
- Marketing headings, pricing pages, and onboarding flows
- Communicating async operations like API fetches or file uploads
- Replacing blank screens during server-side rendering hydration
- Inline loading states within tables, feeds, or infinite-scroll lists
Performance characteristics
- GPU-accelerated — uses CSS transform and opacity so compositing happens off the main thread
- Zero JavaScript dependency in most configurations — no framework, no bundler required
- Approximately 60 fps on any device that supports CSS animations (Chrome 43+, Firefox 16+, Safari 9+)
- Typically under 2 KB of CSS — negligible impact on Largest Contentful Paint (LCP)
How it compares
Unlike JavaScript spinners rendered with requestAnimationFrame loops, the Skeleton Text Blocks runs on the GPU compositor thread, meaning a blocked main thread — caused by heavy data processing or framework hydration — will not freeze or jank the animation.
Compared to GIF loading indicators, this CSS approach uses roughly 95% less bandwidth and scales crisp at every pixel density, including HiDPI and Retina displays.
Source code
CSS
.block { width: 280px; }
.block span { display: block; height: 12px; background: linear-gradient(90deg,#27272a 0%,#3f3f46 0%,#3f3f46 28%,#27272a 28%); background-size: 200% 100%; border-radius: 4px; animation: sh 1.5s ease-in-out infinite; margin-bottom: 8px; }
.block span:nth-child(1){width:100%}.block span:nth-child(2){width:95%}.block span:nth-child(3){width:88%}.block span:nth-child(4){width:70%}
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
body { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f0f0f; }HTML
<div class="block"><span></span><span></span><span></span><span></span></div>Full source
<!DOCTYPE html>
<html><head><style>
.block { width: 280px; }
.block span { display: block; height: 12px; background: linear-gradient(90deg,#27272a 0%,#3f3f46 0%,#3f3f46 28%,#27272a 28%); background-size: 200% 100%; border-radius: 4px; animation: sh 1.5s ease-in-out infinite; margin-bottom: 8px; }
.block span:nth-child(1){width:100%}.block span:nth-child(2){width:95%}.block span:nth-child(3){width:88%}.block span:nth-child(4){width:70%}
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
body { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f0f0f; }
</style></head><body><div class="block"><span></span><span></span><span></span><span></span></div></body></html>Frequently asked questions
How do I add the Skeleton Text Blocks to my project?
Copy the full source code from the code block on this page. Paste the <style> block into your stylesheet (or a <style> tag in your HTML head) and the HTML markup into your template. No npm install or build step is required — the animation is self-contained. To customize colors, speed, or size, use Grepped's workspace at grepped.dev/animations/state-feedback/skeleton-text-blocks.
Is the Skeleton Text Blocks free to use?
Yes. All Grepped preset animations are free to use in personal and commercial projects. You may copy, modify, and redistribute the code without attribution. The only limitation is that you may not resell the presets themselves as part of a competing animation library.
Does the Skeleton Text Blocks work on mobile browsers?
Yes. The Skeleton Text Blocks uses standard CSS animations and transforms that are supported in all modern mobile browsers — Chrome for Android, Safari on iOS 9+, Samsung Internet, and Firefox for Android. Where JavaScript is used for interactivity (e.g. cursor effects), it falls back gracefully on touch devices.
Can I customize the Skeleton Text Blocks's colors, speed, or size?
Yes. Open the live customization workspace at grepped.dev/animations/state-feedback/skeleton-text-blocks to adjust the animation with real-time sliders, color pickers, and toggles — no code required. For deeper changes, the source code uses CSS custom properties (variables) so you can edit them directly in your stylesheet.
Want to customize this animation or generate a new one from a text prompt?
Open in Workspace — it's free