agentleFS
Mostafashadow1Mostafashadow1/agent-skills/skills/react-loadly-loading-states/SKILL.md

react-loadly-loading-states

Skill0 starsChanged 11 days agoMITView on GitHub

Build loading states in React or Next.js (skeletons of existing components with Skeletonize, spinners, skeleton screens, loading/error/empty switching, async loading hooks) with the react-loadly npm package. Use when a task mentions loaders, spinners, skeletons, placeholders, 'show something while data loads', or Suspense fallbacks.

  • Installs packages

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not for: Progress bars for route changes at the top of the page (use nprogress or the router's own indicator).

    line 17
  2. Very specific:

    Check package.json first. If the project already uses react-spinners, react-loading-skeleton, keep using it unless the user asks to switch.

    line 25
  3. Very specific:

    Import the stylesheet once in the app root: import "react-loadly/styles.css" (or wrap the app with <LoadlyProvider>, which injects styles).

    line 31
  4. Very specific:

    Always set a meaningful aria-label such as "Loading orders".

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

React Loadly (react-loadly)

React Loadly gives React and Next.js apps accessible loading UI: 30+ spinners/loaders, Skeletonize (turns your real component into its skeleton), SkeletonLoader and SkeletonGroupLoader for skeleton screens, SkeletonSwitchLoader for loading/error/empty switching, and loading-state hooks. TypeScript, SSR-friendly, ARIA role="status", reduced-motion support.

When to reach for it

  • A component fetches data and needs a skeleton or spinner while it loads.
  • You want a skeleton that matches your real component exactly, without writing a second skeleton layout (Skeletonize).
  • You want one component that switches between loading, error, empty and content (SkeletonSwitchLoader).
  • You need accessible loaders (role="status", aria-label, reduced motion) without writing CSS animations.
  • You need a fullscreen or page-level loader, or a Suspense / next/dynamic fallback.

Not for: Progress bars for route changes at the top of the page (use nprogress or the router's own indicator).

Setup

npm install react-loadly

Check package.json first. If the project already uses react-spinners, react-loading-skeleton, keep using it unless the user asks to switch.

Rules

  • To skeleton an existing component, wrap it: <Skeletonize loading={isLoading}><UserCard user={data ?? placeholderUser} /></Skeletonize>. Pass realistic placeholder data while loading; the real component renders and its text, images, icons and controls become skeleton blocks. Do not write a separate skeleton layout for a component you can wrap.
  • For skeletons of UI that does not exist yet (e.g. a page shell), use explicit SkeletonLoader + SkeletonGroupLoader. AutoSkeletonLoader is deprecated and will be removed in v4; do not use it.
  • Skeletonize props: loading, animation, baseColor, highlightColor, speed, loadingLabel, as. Add data-skeleton to an element that should also become a block.
  • Import the stylesheet once in the app root: import "react-loadly/styles.css" (or wrap the app with <LoadlyProvider>, which injects styles).
  • SkeletonLoader props: variant ("text" | "rectangular" | "circular" | "rounded"), width, height, count, animation ("shimmer" | "wave" | "pulse" | "none"), borderRadius, baseColor, highlightColor.
  • Loaders share base props: size, color, speed, loading, aria-label, showText, loadingText, fullscreen, loaderCenter, className, style.
  • SkeletonSwitchLoader props: loading, error, empty, skeleton, errorFallback, emptyFallback, transition.
  • Subpath imports keep bundles smaller: react-loadly/loaders, react-loadly/skeleton, react-loadly/hooks.
  • Components use React context and hooks, so in Next.js App Router use them from files that start with "use client" (or pass them as client-component fallbacks).
  • Always set a meaningful aria-label such as "Loading orders".

Examples

Skeletonize an existing component

"use client";
import { Skeletonize } from "react-loadly";

const placeholderUser = { name: "Loading name", role: "Loading role", avatar: "" };

export function Profile({ query }) {
  return (
    <Skeletonize loading={query.isLoading} loadingLabel="Loading profile">
      <UserCard user={query.data ?? placeholderUser} />
    </Skeletonize>
  );
}

Skeleton card

import { SkeletonGroupLoader, SkeletonLoader } from "react-loadly";
import "react-loadly/styles.css";

export function ProfileCardSkeleton() {
  return (
    <SkeletonGroupLoader shimmerSync stagger={0.08}>
      <SkeletonLoader variant="circular" width={56} height={56} />
      <SkeletonLoader variant="text" width="70%" height={16} />
      <SkeletonLoader variant="text" width="45%" height={12} />
    </SkeletonGroupLoader>
  );
}

Loading / error / empty switch

"use client";
import { SkeletonSwitchLoader } from "react-loadly";

export function Orders({ query }) {
  return (
    <SkeletonSwitchLoader
      loading={query.isLoading}
      error={query.error}
      empty={query.data?.length === 0}
      skeleton={<OrdersSkeleton />}
      errorFallback={(e) => <p>Could not load orders: {e.message}</p>}
      emptyFallback={<p>No orders yet.</p>}
    >
      <OrdersTable rows={query.data} />
    </SkeletonSwitchLoader>
  );
}

Spinner

import { SpinLoader } from "react-loadly/loaders";

<SpinLoader size={32} color="#6366f1" aria-label="Saving" />;

API

  • Skeletons: Skeletonize, SkeletonLoader, SkeletonGroupLoader (stagger, shimmerSync), SkeletonSwitchLoader, SkeletonPatternLoader, AutoSkeletonLoader (deprecated).
  • Loaders: SpinLoader, PulseLoader, WaveLoader, DotsLoader, BarsLoader, BounceLoader, RingLoader, RotateLoader, GridLoader, TypingLoader, BlobLoader, FlowLoader, LiquidLoader, LogoSpinLoader, MorphLoader, OrbitLoader, OrbitDotsLoader, PlaneLoader, ProgressRingLoader, RippleLoader, SignalLoader, SnakeLoader, SpinDotsLoader, SquaresLoader, StairLoader, HashtagLoader, HeatmapLoader, EqualizerLoader, GradientRingLoader, CardFlipLoader, ElementLoader, FallbackLoader.
  • Provider: LoadlyProvider (theme "light" | "dark", color, secondaryColor, speed, injectStyles, loaderCenter).
  • Hooks: useLoaderState, useMultipleLoaderStates, useAsyncLoader(asyncFn, deps, options), useFullscreen, useSkeletonState, useSkeleton, useSkeletonTheme.

Docs: https://mostafashadow1.github.io/react-loadly/

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.