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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

DEV Community

What You Actually Get from GitHub Student Developer Pack (No Corporate Fluff) ⚡ Unshackling Freelance Payments in Nigeria: Why I Abandoned Traditional Platforms Unchaining Freelance Payments in Nigeria: Why Traditional Platforms Are Failing Us I Tested Every Godot AI Plugin So You Don't Have To MCP Server Integrations Aren't the Security Risk. Your Vendor Might Be. Building Payment Infrastructure for the Unbanked: Why I Had to Ditch Traditional Platforms Why Code Golfing is the Ultimate Test for Multimodal LLMs (And a New Benchmark to Prove It) Decoding Solana Account Data: Three Methods Compared MCP Just Landed on Your Phone: What Google AI Edge Gallery Actually Does I Made My Website "Alive" using Physics (Vanilla JS Experiment Part 2) 🚀 Stop Asking “Which Model?” and Start Fixing Your Team’s AI Supply Chain [Image Test C] How to Prompt AI Tools to Write Accurate SQL Queries (And Why Most Developers Get This Wrong) Stop Asking “Which Model?” and Start Fixing Your Team’s AI Supply Chain [Image Test B] Stop Asking “Which Model?” and Start Fixing Your Team’s AI Supply Chain [Image Test A] PayPal and Stripe Are Not the Answer for Global Digital Sales Signs your WordPress site needs a headless CMS rebuild Sanity CMS vs Contentful for Next.js projects: an honest comparison Sanity vs Strapi vs Payload CMS: an honest comparison for 2026 Sanity CMS website cost in 2026: what founders actually pay INP for React Apps: Profiling and Eliminating Long Tasks Why Core Web Vitals Matter (and How I Improve Them) Why AI Agents Love Boring Code I got tired of manual WordPress maintenance across 8 client sites - so I automated all of it My PR Merged Into a Graveyard: On the Rise of Antigravity and the Fall of Open Source Private AI on a Normal Android Phone: Building Krexel with Gemma 4 E2B The Best Result This Week Was a Failed Prediction — Phase-3a Doesn't Transfer Embedding 685 million texts in 32 minutes I Asked the Top 6 AI Chatbots to Sell Me on Themselves - Then Asked Each One Who Came Second Hello World JahSeeToo The First Malaysia's Hacker i watched google tear down the old internet from a hostel room in kolkata How I audit and prune unused Sanity document types to reclaim Studio performance What is MCP, and why it's the missing layer between AI and your CRM Stop adding print statements to debug your data pipeline — use watcher instead Hire a Sanity developer vs agency: five honest trade-offs Temporal vs Make for API-First Workflows The Antigravity 2.0 Forced Update: How to Fix the Broken Editor Loop 10 Ways To Reduce Your LLM API Costs mcp-probe v1.0.0: A CI readiness gate for MCP servers Building ValoVault: The Per-Agent Skin Loadouts Riot Never Shipped Most CMS Platforms Aren’t Built for Full Lifecycle Ownership 45 MB of Claude Code Sessions You Don't See Building a Resilient Checkout in NestJS: Retry, Idempotency, and a System That Tunes Itself Html learning journey I built an open-source alternative to ViciDial. Here's the stack, and the bugs that ate my nights. Zero-PC Architecture: Deploying Webhooks & AI Triage from a Mobile Footprint Why AI Coding Agents Fail Senior Engineers (And What I Built to Fix It) Stop Pasting URLs into Security Header Sites - Use This CLI 26 of 39 AI Companies Use SPF Softfail — Their Email Can Be Spoofed Mastering useRef in React: The Hook That Gives React Memory Without Re-Rendering One Brain, Many Hands: Building a Parallel Task Orchestrator for AI Agents Understanding useRef in React: Concepts, Use Cases, and Examples An AI That Can't Trade, a Human That Can't Say No SSH died. Spent 3 hours fixing the wrong thing. ## Rise of the Managed Agent: Why Antigravity 2.0 is Google I/O 2026’s Most Critical Developer Release From Concept to Production: A Technical Guide to Deploying Markus Multi-Agent Systems Why Browsers Outpaced Web Tooling (And How We Catch Up) First Principles Building a Safety-First RAG Triage Agent in Python Gemma 4 Isn’t Just Another AI Model — It’s A Shift In How We Build AI The Feature Store: Consistency and Latency Are Both Non-Negotiable What did gemma see? - Thinking in comments... I Built a Desktop Chat App for Running Local LLMs Offline Alert Fatigue Is a Design Choice: Building Views That Actually Help Building A Laravel Google Sheets Package That Imports, Exports, Caches, Formats, And Tests Cleanly DOM Accessibility Tree Extraction: A Reliable Method for LLMs on Dynamic Web Tables Building a Production Grade AWS Infrastructure Project (Part 1) Google just shifted the agent workflow from the cloud to the desktop I built a Claude skill that keeps your AI coding tools from contradicting each other — and I need beta testers Google I/O 2026 - Day 1 - Live from the Front Row The Effect of Frosted Glass (Glassmorphism) in Pure CSS in 2026 Solana's Account Types Are Just Database Rows With Different Flags Gemini vs. ChatGPT for Coding: A Developer's Guide Cryptographic Forensics for AI Coding Agent Sessions Testing NGB Platform Beyond a Small Demo Dataset with k6 and TypeScript Metabase 61: AI fun police, build questions and dashboards with MCP, and much more! How GBase 8a Rough Index Works: Block‑Level Pruning for 10x Faster Queries The Anti-Antigravity Bulkhead vs Rate limiting. The Age of Accountable Agents: Building Trust in Your AI Automation Securing Your AI Agents: Essential Practices for On-Device Automation I benchmarked OpenAI's new GPT-Realtime-Translate against four other live translation systems The Code Nobody Will Delete Building a desktop studio for interactive video stories like Late Shift - Devlog #1 Solving the Local AI Sandbox Issue: How TaigaAI Keeps Your Workstation Safe Why Enterprises Will Struggle With MCP — And What to Do About It Why I Finally Added a Blog to My Converter Tool When Your Coding Agent's String-Matcher Becomes a Billing Decision Building ThreatPulse IDS: An AI-Powered Intrusion Detection System I Built a Register-VM JavaScript Engine in Rust with opencode.ai — Beating QuickJS Per-User OAuth for AI Agents: Why It Matters and What to Look For You Got Your Whole Genome Sequenced. Now What? Zero to Full-Stack in 6 Months: The Izzy Way... PasteCheck v1.3 — what I improved after launching and getting real users DeepSeek V4 on Huawei's Ascend 950: A Real Stress Test for China's AI Chip Ecosystem How Strong Is "Strong"? Password Entropy in Plain English Precision Mechatronics: Mitigating Step-Pulse Resonance and Thermal Dissipation in Micro-Stepping Hardware Controllers A Fact A Day, an autonomous Podcast as my entry 4 Hermes Agent Challenge #100DaysOfSolana Day29: My Experience Generating Token On Solana Devnet Overcoming Challenges and Applying Best Practices in Migrating Large JavaScript Codebases to TypeScript
Stop writing skeleton shapes by hand — auto-skeleton does it for you
Riaz Ahmed · 2026-05-17 · via DEV Community

Riaz Ahmed

Skeleton screens are one of the best things you can do for perceived performance. But maintaining a separate set of hand-drawn rectangles and circles that mirror your real UI? That part is a grind — and it silently breaks every time your layout changes.

auto-skeleton fixes this. It measures your actual rendered DOM at runtime using getBoundingClientRect and generates pixel-accurate skeletons automatically. No shape definitions. No CLI snapshots. No config files. Just wrap your component and you're done.


The problem with existing solutions

Most skeleton libraries put the burden on you. You describe the skeleton — "three lines, one circle, two rectangles" — and hope it still matches your UI six sprints from now.

Feature Manual shapes CLI snapshot tools auto-skeleton
Zero config Partial
No build step
Always in sync with real UI Partial
Adapts to dynamic content
Cached for instant reloads

The core issue with manual approaches is that the skeleton is a second source of truth. auto-skeleton eliminates that entirely.


How it works

Rather than asking you to describe your UI twice, auto-skeleton reads it once — at runtime, on the real DOM.

  1. On the first non-loading render, the DOM inside <AutoSkeleton> is scanned using a TreeWalker
  2. Each visible element is measured with getBoundingClientRect and classified as a rect, circle, or text block
  3. Bone positions are stored in memory and sessionStorage keyed by id + viewport width
  4. When loading switches back to true, an absolutely-positioned overlay renders the cached bones instantly
  5. The real content is hidden (visibility: hidden) so layout is preserved during loading

React quick start

npm install @auto-skeleton/react

Enter fullscreen mode Exit fullscreen mode

import { AutoSkeleton } from "@auto-skeleton/react";
import "@auto-skeleton/react/styles.css";

function UserProfile({ userId }) {
  const { data, isLoading } = useUser(userId);

  return (
    <AutoSkeleton id="user-profile" loading={isLoading}>
      <div className="profile">
        <img src={data?.avatar} data-skeleton-shape="circle" />
        <h2 data-skeleton-lines="1">{data?.name}</h2>
        <p data-skeleton-lines="3">{data?.bio}</p>
      </div>
    </AutoSkeleton>
  );
}

Enter fullscreen mode Exit fullscreen mode

data-skeleton-shape="circle" tells the scanner to render the avatar as a circle. data-skeleton-lines="3" splits the paragraph into three stacked text lines. Both are optional — the scanner makes reasonable guesses without them.


Vue 3 quick start

npm install @auto-skeleton/vue

Enter fullscreen mode Exit fullscreen mode

<script setup>
import { ref } from "vue";
import { AutoSkeleton } from "@auto-skeleton/vue";
import "@auto-skeleton/vue/styles.css";

const loading = ref(true);
</script>

<template>
  <AutoSkeleton id="user-profile" :loading="loading">
    <UserProfileCard />
  </AutoSkeleton>
</template>

Enter fullscreen mode Exit fullscreen mode

No changes required to UserProfileCard itself — the wrapper handles everything.


Lit / Web Components

npm install @auto-skeleton/lit lit

Enter fullscreen mode Exit fullscreen mode

import "@auto-skeleton/lit";

Enter fullscreen mode Exit fullscreen mode

<auto-skeleton skeleton-id="feed" .loading=${this.isLoading}>
  <feed-list></feed-list>
</auto-skeleton>

Enter fullscreen mode Exit fullscreen mode

Works natively in any framework — or no framework at all. The scanner crosses Shadow DOM boundaries automatically, so nested Lit components are discovered without extra configuration.


Options

Option Type Default Description
animation `"wave" \ "pulse" \ "none"`
debug boolean false Outline detected bones with dashed borders
cache boolean true Cache measurements after first scan
minSize number 8 Minimum element size (px) to include
watchDebounceMs number 120 Debounce delay for layout change re-scans
ignoreSelectors string[] [] CSS selectors for elements to skip

Data attributes

Fine-tune individual elements without changing render logic:

Attribute Effect
data-skeleton-ignore Skip this element entirely
data-skeleton-shape="circle" Force a circular bone
data-skeleton-lines="N" Split into N stacked text-line bars
data-skeleton-container Scan children individually instead of as one block

Theming

Two CSS custom properties control the entire look:

:root {
  --as-base: #e4e4e7;
  --as-highlight: rgba(255, 255, 255, 0.9);
}

.dark {
  --as-base: #27272a;
  --as-highlight: rgba(255, 255, 255, 0.05);
}

Enter fullscreen mode Exit fullscreen mode

--as-base is the bone colour. --as-highlight is the shimmer that sweeps across during the wave animation.


Why this matters beyond convenience

The maintenance cost of manual skeletons is easy to underestimate. It's not just the initial setup — it's every subsequent layout change. Your designer widens the avatar. You add a badge. The bio gets a second paragraph. Each change requires you to remember to update the skeleton too. Most teams don't. The result is skeletons that subtly diverge from the real UI, undermining the perceived-performance benefit they were supposed to deliver.

auto-skeleton makes this a non-issue. The skeleton is derived from the real UI, so it stays correct by construction. You only intervene with data attributes when you want to fine-tune — not to keep things from drifting.

This also makes it significantly faster to add loading states to new components. You don't need to design the skeleton separately — you just wrap the component and move on.


Try it

All packages are at v0.0.7. If you've been putting off skeleton loaders because of the setup cost — this is the week to change that. Drop a comment if you run into anything, and a ⭐ on GitHub goes a long way at this stage.