Charcoal UI

Skeleton

Placeholder blocks with a soft light sweep, plus SkeletonSwap, which cross-fades to the real content with a short blur.

  • Category: Feedback
  • Licence: Free, MIT
  • Built with: React 19, Tailwind CSS 4, Motion
  • Dependencies: motion, clsx, tailwind-merge

Examples

Skeleton

API reference

PropTypeDefaultDescription
<Skeleton />ComponentProps<"div">—Size it with className.
<SkeletonSwap loading skeleton>boolean / ReactNode—Cross-fades to children when loading turns false.

About Skeleton

Skeleton draws placeholder blocks with a soft light sweep, and SkeletonSwap crossfades to the real content with a short blur, so loading never feels like a flash.

Skeleton is a feedback component for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.

When to use Skeleton

  • Feeds and lists.
  • Profile and product cards.
  • Dashboards loading data.
  • Article pages.

How it works

Blocks are plain divs sized with classes; the sweep is a CSS gradient animation. SkeletonSwap holds the placeholder until ready, then animates opacity and blur.

State changes are announced through live regions or the right ARIA roles, so screen-reader users hear what sighted users see. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.

Customizing Skeleton

Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.

The Customize panel next to the preview lets you change name, role live, and the Code tab updates to match, so the snippet you copy already carries your values.

  • <Skeleton /> (ComponentProps<"div">): Size it with className.
  • <SkeletonSwap loading skeleton> (boolean / ReactNode): Cross-fades to children when loading turns false.

Goes well with Skeleton

These feedback pieces share its tokens and motion language, so they sit together on one page without clashing.

  • Progress: Animated React progress bars and rings on springs, with an indeterminate sweep
  • Loader: Four quiet React loaders, dots, bars, orbit and pulse, that announce themselves
  • Status Badge: A React status badge that morphs between states with a pulsing live dot
  • Alert: Animated React alerts for info, success, warning and error that collapse smoothly
  • Typing Indicator: A React typing indicator: a bubble with rippling dots that tells screen readers who is typing

Install Skeleton

npx shadcn@latest add https://charcoalui.com/r/skeleton.json

Skeleton is free and MIT licensed. The command copies skeleton.tsx into components/ui and installs clsx, tailwind-merge; you can also copy the source from the Code tab by hand.

It pairs well with Image Generation, a Pro piece: A dot field stirs while the model works, then each dot takes the colour beneath it until the picture resolves.

Frequently asked questions

How do I swap a skeleton for real content?
Use SkeletonSwap with a ready flag. It shows the skeleton until ready, then crossfades to the content with a short blur.
How do I install Skeleton?
Run npx shadcn@latest add https://charcoalui.com/r/skeleton.json. The shadcn CLI copies skeleton.tsx into components/ui and installs motion, clsx, tailwind-merge. You can also copy the source from this page by hand.
Is Skeleton free for commercial use?
Yes. Skeleton is MIT licensed: use it in any personal or commercial project and change it however you like.
Does Skeleton work with Next.js?
Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
Can an AI coding agent install Skeleton?
Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Skeleton's props and source and get_install_command returns the exact command.

Skeleton as Markdown · llms.txt