Getting Started

Shimmer From Structure is a structure-aware skeleton loader that automatically mirrors your rendered UI at runtime. No need to maintain separate skeleton components.

Why This Library?

Traditional shimmer libraries require you to:

  • Manually create skeleton components that mirror your real components
  • Maintain two versions of each component (real + skeleton)
  • Update skeletons every time your layout changes

Shimmer From Structure eliminates all of that:

  • ✔ Works with React, Vue, Svelte, Angular & SolidJS
  • ✔ Automatically measures your component's structure at runtime
  • ✔ Generates shimmer effects that match actual dimensions
  • ✔ Zero maintenance - works with any layout changes
  • ✔ Works with complex nested structures
  • ✔ Supports dynamic data with templateProps
  • ✔ Preserves container backgrounds during loading
  • ✔ Auto-detects border-radius from your CSS

Installation

Install the package for your specific framework using your preferred package manager:

npm install @shimmer-from-structure/react
# or
yarn add @shimmer-from-structure/react
# or
pnpm add @shimmer-from-structure/react

Quick Example

Here's a simple example with each framework:

import { Shimmer } from '@shimmer-from-structure/react';

function UserCard() {
  const [loading, setLoading] = useState(true);

  return (
    <Shimmer loading={loading}>
      <div className="card">
        <img src="avatar.jpg" className="avatar" />
        <h2>John Doe</h2>
        <p>Software Engineer</p>
      </div>
    </Shimmer>
  );
}

That's it! The shimmer effect will automatically match the structure and dimensions of your component.

Next Steps