react-loading-skeleton: sizing skeletons from the styles you already wrote
Create skeleton screens that automatically adapt to your app!
At a glance
- What is it?
- react-loading-skeleton builds loading placeholders that inherit the font size and line height of the content they replace. It suits component-level loading states, not full-page route transitions, and it asks for a CSS import that is easy to forget.
- Who is it for?
- Adopt react-loading-skeleton if your loading states live inside components that already render headings, paragraphs or cards, and you want the placeholder to track your typography instead of a hand-built mock. Do not adopt it for full-page route transitions, for React Native, or where the placeholder must be a diagram of a complex layout; it renders lines and circles, not arbitrary shapes.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 8 months ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- dvtng/react-loading-skeleton4,214 ★ · +7
| Repository | 2026-09-23 | 2026-11-22 |
|---|---|---|
| dvtng/react-loading-skeleton | 4.2k | 4.2k |
7 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The problem react-loading-skeleton solves for React apps with real typography
A loading spinner tells the user that something is happening. It does not tell them what shape the answer will take, and when the answer arrives the page reflows. A skeleton screen fixes the reflow problem, but hand-built skeletons drift: someone changes the heading font size, the placeholder still assumes the old one, and the page jumps on load anyway.
The README states the project's position plainly: other libraries "require you to meticulously craft a skeleton screen that matches the font size, line height, and margins of your content," while the Skeleton component "is automatically sized to the correct dimensions." The intended audience is React developers who want loading states to live inside the components that own the content, rather than in a separate screen assembled for each route.
How the component derives its size from the surrounding element
The mechanism is inheritance rather than measurement. The README's blog post example places a Skeleton where the content would go: an h1 renders either the title or a Skeleton, and a body block renders either the body or a Skeleton with count={10}. Because the placeholder sits inside the heading or paragraph element, it picks up that element's computed font size and line height. The default height of each skeleton line is documented as "The font size," which is what makes the heading skeleton taller than the body skeleton without any configuration.
Height and width are the two props that drive layout. width defaults to 100% and height defaults to the font size, so a single Skeleton inside a paragraph fills the available width at one line's height. count controls how many lines render, and the README notes that a decimal such as 3.5 produces three full skeletons and one half-width skeleton, which is a rough way to imitate a paragraph whose last line is short. The inline prop changes the flow: by default a br element is inserted after each skeleton so each occupies its own line, and inline={true} suppresses that.
Styling runs through two layers. A SkeletonTheme higher in the React tree sets baseColor and highlightColor for every skeleton below it, with defaults of #ebebeb and #f5f5f5. Individual skeletons can override those, and the style prop is documented as an escape hatch for advanced cases, with the explicit warning that props such as width and borderRadius take priority over the style object. That ordering matters: putting width in style will not win.
Installing react-loading-skeleton and rendering a first placeholder
The README gives two package managers. Either command installs the current published version, 3.5.0 according to package.json.
yarn add react-loading-skeleton
npm install react-loading-skeletonThe import that trips people up is the stylesheet. The component ships without its animation CSS applied unless you import it, and the README's basic usage shows both lines together.
import Skeleton from 'react-loading-skeleton'
import 'react-loading-skeleton/dist/skeleton.css'
<Skeleton /> // Simple, single-line loading skeleton
<Skeleton count={5} /> // Five-line loading skeletonAfter this, a single Skeleton renders one animated bar at the current font size, and count={5} renders five. The package.json exports map declares the CSS under the key ./dist/skeleton.css, so the subpath import is the supported route rather than reaching into the dist folder by another path.
The README's recommended pattern is to put the skeleton inside the component that owns the data, not in a separate loading screen. That example renders the title and body independently, so the title can resolve while the body still shows ten skeleton lines. Theming applies at any level: wrapping a subtree in SkeletonTheme with baseColor="#202020" and highlightColor="#444" restyles every skeleton beneath it.
Where react-loading-skeleton is the wrong tool
The library renders lines and circles. It has no notion of a card grid, a chart, a table with column widths, or an avatar next to two stacked text lines, unless you compose those from individual Skeleton elements yourself. A dashboard placeholder that mirrors a complex layout will end up as a hand-built arrangement of Skeleton components, at which point you have written the dedicated skeleton screen the README argues against, just with a different primitive.
Size inheritance is also an assumption, not a guarantee. It works when the skeleton sits inside the element whose typography you want, as in the h1 and paragraph examples. If you render a Skeleton in a flex container, a grid cell, or a wrapper whose font size differs from the eventual content, the placeholder takes the wrapper's metrics and the reflow returns.
The component is React only. The package metadata describes a React package, and the README documents React props and a React context provider. There is no React Native entry point in the exports map, and no framework-agnostic build. This is not the library for a Vue, Svelte or server-rendered-HTML-only project.
One more boundary: containerTestId is documented for React Testing Library queries, which helps tests, not screen readers.
How it differs from MUI's Skeleton and from spinner-only loading states
The README contrasts the library with others that require you to meticulously craft a skeleton screen matching the font size, line height and margins of your content. react-loading-skeleton instead sizes the placeholder from the element that wraps it, which is why the README can claim the loading state stays in sync with layout changes without further configuration.
Against a plain spinner, the trade is information density versus simplicity. A spinner is one element and works anywhere. A skeleton communicates structure and reserves space so the layout does not shift, but it costs you a decision per component about how many lines to reserve. The README's own guidance is that components should represent all possible states, loading included, which is a structural commitment rather than a drop-in swap.
Maintenance, version 3.5.0 and the MIT licence
The repository is not archived. Its last push was on 2026-03-05, and the most recent release listed is v3.5.0 from 2024-09-23. Releases are infrequent: v3.4.0 came in February 2024 and v3.3.1 in May 2023. Treat this as a small, stable surface rather than a project with a fast-moving roadmap, and pin the version you depend on.
The upgrade cost from version 2 is real and the README points readers to a dedicated changes-in-version-3 release note plus the v2 documentation branch. If you are on v2, read that note before moving, because the v3 API is what this article describes throughout.
The package is MIT licensed, and package.json declares "license": "MIT" with the LICENSE file at the repository root. That permits commercial use and modification; it also means the project offers no warranty, and you carry the obligation of retaining the copyright notice in distributed copies. This is a description of the licence text, not legal advice, and your own counsel should confirm how it applies to your distribution model.
Editorial conclusion
Adopt react-loading-skeleton if your loading states live inside components that already render headings, paragraphs or cards, and you want the placeholder to track your typography instead of a hand-built mock. Do not adopt it for full-page route transitions, for React Native, or where the placeholder must be a diagram of a complex layout; it renders lines and circles, not arbitrary shapes. Before committing, verify three things: that you import react-loading-skeleton/dist/skeleton.css, that your version is the current 3.5.0, whose exports map declares the ./dist/skeleton.css subpath, and that the skeleton heights match your real text at your smallest and largest breakpoints. The count prop accepts decimals, so a value like 3.5 gives three full lines and one half-width line; check that this matches how your real text wraps.
Frequently asked questions
How do I use react-loading-skeleton in a React component?
Import the Skeleton component and the stylesheet, then render Skeleton in place of the content that is loading. The README's example renders a single Skeleton for one line and Skeleton count={5} for five lines, placed inside the same heading or paragraph element as the real content so it inherits that element's typography.
How do I install react-loading-skeleton?
The README gives two options: yarn add react-loading-skeleton or npm install react-loading-skeleton. The package is published as react-loading-skeleton, and the current version in package.json is 3.5.0.
What is react-loading-skeleton?
It is a React component that renders animated loading placeholders which are automatically sized to the content they replace. The README describes the goal as making skeletons that adapt to the styles you have already defined, so the loading state stays in sync with layout and typography changes.
When should I use a skeleton instead of a spinner?
Its argument is structural: a skeleton placed inside the component that owns the content reserves the correct space and keeps styles in sync, and the README recommends components carry their own built-in loading state rather than a separate dedicated skeleton screen.
Is there an alternative to react-loading-skeleton?
The README contrasts it with other libraries that require you to meticulously craft a skeleton screen that matches the font size, line height and margins of your content, while its Skeleton component is automatically sized to the correct dimensions.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/dvtng-react-loading-skeleton)Star history chart for your README
[](https://hysenlabs.com/projects/dvtng-react-loading-skeleton)Was this useful?