Component
Skeleton
A layout-matching loading primitive with a subtle shimmer.
Preview
Installation
Install the package, then import the component and shared stylesheet in your app.
Package install
Install the package when you want components imported from axie-ui.
install
pnpm add axie-uiImport
code
import "axie-ui/styles.css";import { Skeleton } from "axie-ui";Registry install
Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.
registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/skeleton.jsonCopied source import
code
import "@/styles/axie.css";import { Skeleton } from "@/components/axie/skeleton";Prefer @axie/skeleton? Add the Axie namespace once from the Installation page, then use that shorthand.
Usage
code
import { Skeleton } from "axie-ui";export function Example() { return <Skeleton className="h-12 w-full" />;}Accessibility
- Skeletons should match the approximate shape of the loading content.
- Avoid announcing every skeleton element to screen readers.
- Replace skeletons with content or an error state once loading finishes.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Classes control the skeleton size. |