- Home
- Skills
- Frontend & Web Apps
- React Loadly Loading States
React Loadly Loading States
Build loading states in React and Next.js with react-loadly: Skeletonize, skeleton screens, spinners and loading/error/empty switching.
Free
Works with the AI Agents you already use
React Loadly Loading States
Example session with this skill installed
Create a loading state for a user profile card. Wrap the UserCard component so it skeletons while loading, and use a circular loader for the avatar.
- Read your context and instructions
- Compiled the react loadly loading
- Generated the UI component
I have implemented a skeleton loading state for the user profile card using react-loadly. I used the Skeletonize wrapper for the main card to ensure the layout matches the final UI, and defined a placeholder user object to maintain structure during the loading phase.
Profile Card Loading Implementation
"use client";
import React from "react";
import { Skeletonize, SkeletonGroupLoader, SkeletonLoader } from "react-loadly";
import { UserCard } from "./UserCard";
// Mock data to maintain layout structure during skeletonization
const placeholderUser = {
name: "Loading Name",
role: "Loading Role",
bio: "This is a placeholder for the user bio text that will appear once data is fetched.",
avatar: ""
};
export function ProfileCard({ user, isLoading }) {
return (
<Skeletonize
loading={isLoading}
loadingLabel="Loading user profile"
animation="shimmer"
>
<UserCard user={user ?? placeholderUser} />
</Skeletonize>
);
}
// Manual skeleton for custom shell layout if needed
export function ProfileShellSkeleton() {
return (
<div className="p-4 border rounded-lg">
<SkeletonGroupLoader shimmerSync stagger={0.1}>
<div className="flex items-center space-x-4">
<SkeletonLoader variant="circular" width={60} height={60} />
<div className="flex-1">
<SkeletonLoader variant="text" width="60%" height={20} />
<SkeletonLoader variant="text" width="40%" height={14} />
</div>
</div>
<div className="mt-4">
<SkeletonLoader variant="rounded" width="100%" height={80} />
</div>
</SkeletonGroupLoader>
</div>
);
}
Next steps
- Ensure
import "react-loadly/styles.css"is added to your root layout or_app.tsx. - Add
data-skeletonto any other element inUserCardthat should also become a skeleton block. - Pass the
isLoadingboolean from your data fetching hook (e.g., TanStack Query) to theProfileCard.
styles.css
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Managing loading states in React often requires writing redundant skeleton layouts or wrestling with inaccessible CSS spinners. This skill implements react-loadly to handle complex UI transitions, skeleton screens, and accessible loaders with minimal boilerplate.
What it does
- Skeletonize components by wrapping existing UI to transform text, images, and icons into skeleton blocks automatically.
- Switch states using
SkeletonSwitchLoaderto manage loading, error, empty, and data-ready views in one place. - Implement spinners with 30+ accessible variants including
SpinLoader,PulseLoader, andWaveLoader. - Orchestrate groups of skeletons using
SkeletonGroupLoaderto synchronize shimmer effects and stagger animations. - Accessible UI with built-in
role="status", ARIA labels, and support for reduced-motion settings.
How it works
- Analyze requirements for a component needing a loading state, such as a data table or profile card.
- Apply Skeletonize to wrap existing components with placeholder data to mirror the real UI layout.
- Configure loaders using specific variants like
rectangularorcircularfor manual skeleton shells. - Manage states by hooking into async data queries to toggle between loading, error, and content fallbacks.
Frameworks & tools
This skill works with React and Next.js (App and Pages Router). It utilizes the react-loadly library, TypeScript for type safety, and supports SSR environments.
Why this beats prompting it yourself
Writing skeletons manually usually leads to layout shift when the real data arrives. This skill ensures your skeleton matches your actual component 1:1 using Skeletonize and correctly configures ARIA attributes that LLMs often skip by default.
Use cases
- Generating a skeleton for a complex dashboard widget that mirrors the final UI layout exactly.
- Implementing a unified loading, error, and empty state handler for a list of search results.
- Creating an accessible, branded fullscreen spinner for initial app hydration or page transitions.
Known limitations
Does not handle progress bars for top-of-page route changes. In Next.js App Router, components must be used within "use client" files or passed as fallbacks to server components.
Source and latest version: https://github.com/Mostafashadow1/agent-skills (MIT licensed, free). npm: https://www.npmjs.com/package/react-loadly · Docs: https://mostafashadow1.github.io/react-loadly/. Author: Mostafa Shadow.
Not for route-change progress bars. Requires 'use client' directives in Next.js App Router. AutoSkeletonLoader is deprecated and avoided.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
3 uses
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 25 days ago
- Free with an Agensi account