react-loading-skeleton

Animated React skeleton screens that automatically adapt to your app's fonts, sizing, and layout.

Library
npm
v3.5.0
4,207 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
44 /100 Fair
Development Activity 4
Maintenance 20
Community 52
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 80
Code Quality 78
Innovation 55
Learning Curve 90

react-loading-skeleton gives React apps a Skeleton component that stands in for content while it loads, sized automatically to match the font size, line height, and layout of whatever it replaces. Instead of hand-crafting a separate placeholder screen for every view, developers drop <Skeleton /> directly where real content will go — inside a heading, a paragraph, a card — and it renders a correctly-proportioned animated bar without extra CSS.

A SkeletonTheme context provider lets teams set base and highlight colors, animation duration, and direction once for an entire subtree, while individual Skeleton instances can still override any of those values, or supply a custom wrapper component to control layout around repeated lines. The library ships as CSS custom-property-driven markup with a small companion stylesheet, keeping the runtime footprint minimal while remaining fully themeable.

What You Get

  • A Skeleton component that renders one or more animated placeholder lines, with a count prop supporting fractional values for partial last lines
  • A SkeletonTheme context provider for setting base color, highlight color, animation duration/direction, and other style defaults across a whole subtree
  • Per-instance overrides for width, height, border radius, circular shapes, and a custom customHighlightBackground gradient
  • A wrapper prop for wrapping each generated skeleton line in a custom component, useful for grid or card layouts
  • CSS custom-property-based styling shipped as a small companion stylesheet (dist/skeleton.css), keeping bundle size minimal
  • TypeScript type definitions for SkeletonProps and SkeletonThemeProps out of the box

Common Use Cases

  • Rendering blog post or article placeholders where the title loads before the body, each showing its own skeleton independently
  • Building skeleton states for dashboard cards, tables, and lists where the number of rows is dynamic (count prop)
  • Applying a consistent brand theme (colors, animation speed) across every loading skeleton in an app via a single SkeletonTheme wrapper
  • Showing circular avatar placeholders in user profile or comment lists using the circle prop
  • Disabling the shimmer animation and rendering a static solid-color placeholder when an error occurs instead of a loading state

Under The Hood

Architecture The library is intentionally small and flat: Skeleton.tsx contains the single rendering component, SkeletonTheme.tsx and SkeletonThemeContext.ts implement a React Context provider for shared style defaults, and SkeletonStyleProps.ts defines the shared style-option shape both consume. Skeleton merges three layers of style precedence — context defaults, explicit props, and a raw style object — into a single set of CSS custom properties (--base-color, --highlight-color, --animation-duration, etc.) applied to plain <span> elements, so no runtime CSS-in-JS engine is involved. Fractional count values are handled by rendering full-width skeleton lines plus one narrower final line computed via calc(), and the whole group is wrapped in a container <span> carrying aria-live/aria-busy attributes for accessibility. There is no internal state, no reducers, and no side effects beyond reading context — a change to the core abstraction would mean changing how style options are merged in this one function. Tech Stack Written in TypeScript and built with tsc plus Rollup (via rollup.config.js and @rollup/plugin-typescript) into ESM and CommonJS bundles declared through package.json exports, with a separate CSS asset copied into dist/. Development uses Vite and @vitejs/plugin-react-swc for fast local iteration and Storybook 7 (with addon-essentials/interactions/links) for interactive component documentation. The only runtime dependency is a peerDependency on react (>=16.8.0); there is no runtime dependency on ReactDOM APIs beyond what React itself requires. Code Quality Tests run under Vitest with @testing-library/react and jsdom, covering rendering counts, style precedence (props vs. context vs. style object), circular skeletons, fractional counts, and theme propagation — a meaningful, focused test suite for a small component library rather than an exhaustive one. Linting is enforced via ESLint with the Airbnb TypeScript config plus eslint-plugin-react/react-hooks/jsx-a11y, Prettier formatting, and a Husky pre-commit hook running lint-staged so unformatted or unlinted code cannot be committed. Types are strict TypeScript throughout with no any usage observed in the core files. API Design The public API is deliberately minimal: one component (Skeleton), one context provider (SkeletonTheme), and a shared style-props interface, all importable from a single entry point (import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'). Getting started requires no configuration beyond importing the component and its stylesheet, and prop names (baseColor, highlightColor, circle, count) map directly to visible behavior with sensible defaults, which keeps the learning curve very low for a first-time integrator.

Used by 11 apps in this directory

JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 6 days ago
Rust
54%
Other

Cap

Team Chat · Video Conferencing

22,884

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
64
Dependency
Built with
Rust 54%
TypeScript 42%
Updated 4 days ago
Rust
67%
Other

DefGuard

Authentication · Networking · Security

2,849

Self-hosted secure remote access that unifies WireGuard VPN, identity management, and connection-level MFA in one open-source platform.

View details
84
Repo Health
82
Technical
72
Dependency
Built with
Rust 67%
TypeScript 31%
Updated 1 weeks ago
TypeScript
48%
AGPL 3.0

Grafana

Analytics · Monitoring

76,962

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript 48%
Go 46%
Updated 4 days ago
TypeScript
71%
Other

highlight.io

Analytics · Developer Tools · Monitoring

9,378

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
67
Repo Health
78
Technical
65
Dependency
Built with
TypeScript 71%
Go 16%
Updated 1 months ago
Python
64%
Other

Keep

Automation · Devops · Monitoring

12,359

The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.

View details
89
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 1 weeks ago
JavaScript
43%
Other

LimeSurvey

Forms Surveys

3,736

The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.

View details
86
Repo Health
62
Technical
63
Dependency
Built with
JavaScript 43%
PHP 35%
CSS 12%
Updated 5 days ago
Go
95%
Other

NetBird

Security

29,568

Replace your VPN with a zero-trust WireGuard overlay network that auto-connects devices, enforces SSO and posture checks, and deploys in under 5 minutes.

View details
91
Repo Health
82
Technical
66
Dependency
Built with
Go 95%
Updated 6 days ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,660

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
90
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers