r/reactjs • u/Ok_Drive6309 • Jun 02 '26
Show /r/reactjs I made React and React Native components generate their own skeleton loaders, zero config, unique animations
http://github.com/J-Ben/skelterThe skeleton loader is the first thing your user sees. Most of us treat it as an afterthought, written by hand, out of sync, breaking every design change.
I wanted to fix this fundamentally.
react-zero-skeleton walks your Fiber tree, measures every element at runtime, and makes your component generate its own skeleton. One bone per element. Exact borderRadius. Always in sync.
export default withSkeleton(ArticleCard)
<ArticleCard hasSkeleton isLoading={isLoading} />
Works for React Native and React web.
What makes it different:
shatter, each bone fragments into a grid of squares with staggered delays. Random, cascade, or radial order. Nothing else does this.
Entry fade-in, intentional not instant. Custom timing via fadeInDuration.
Per-element borderRadius auto-detected. Circles stay circles, pills stay pills.
4.4kb, zero dependencies, zero native code, FlatList optimized, cache aware, RTL, reduceMotion, SSR safe.
2.7k downloads/month, zero marketing.
Live demo: skelter.dev/demo
GitHub: github.com/J-Ben/skelter
npm: react-zero-skeleton
Happy to answer any questions!
11
u/universetwisted Jun 02 '26
This is a pretty neat idea.
The part I’d be most curious about is how it behaves with layout shifts, responsive breakpoints, and components that render very differently after data loads.
6
u/KnifeFed Jun 02 '26
How does it compare to boneyard?
4
u/shuwatto Jun 02 '26
Starred.
May I ask how much impact it has on performance?
3
u/Beastrick Jun 02 '26
I assume there is no way to make this work with suspense since tree is not rendered before it so there is no way to scan it?
2
u/sicmek Jun 02 '26
Looks nice man. But what if a component resizes with the data it loads? For example a List that shows 10 items per page. If you measure the components height before it renders the first data, the skeleton would be much smaller than the real component, right?
Edit: Is there an option to set fixed dimensions for cases like this? So it doesn't trigger the measurement logic there
3
u/Honey-Entire Jun 02 '26
Oh look, another one. Why is everyone building skeleton loaders now? There are plenty of existing libraries and they’ve all been around for years, but instead of contributing to existing projects everyone has decided to spin up their own AI slop and fight for free market share
4
u/chillermane Jun 02 '26
Makes no sense. How do you “measure elements” that aren’t rendered yet
1
u/Vincent_CWS Jun 03 '26
how about GitHub - darula-hpp/shimmer-from-structure: A structure-aware skeleton loader that mirrors your rendered UI at runtime. Zero layout duplication. Built for modern frameworks. · GitHub
1
u/HeathersZen Jun 03 '26
Demo is crashing on chrome iOS.
Application error: a client-side exception has occurred while loading skelter.dev (see the browser console for more information).
I don’t have dev tools configured on this device, so I don’t have the console logs.
2
u/Short-Opportunity537 Jun 02 '26
Useful
0
u/CamiloCNFGS Jun 02 '26 •
Best thing ive ever learn and needed thx ! 🙏