Avatar skeleton

A set of five decorative avatar-plus-text skeleton placeholders (AvatarCircleSkeleton, AvatarSquareSkeleton, StackSkeleton, InlineSkeleton, DetailSkeleton) that show the loading shape of user avatars and their text. Each uses a calm framer-motion opacity pulse, is sized sm to xl, and is hidden from assistive technology.

componentstyledskeletonregistry-item.json
Avatar skeleton
LIVE · running in a sandboxed iframe
Installed with shadcn add · 2 workarounds · theme from registry.json
  • applied the registry's theme (tokens, fonts and CSS from the registry preview settings)
  • installed base item https://ai2.design/r/tokens.json (registry preview settings)
See how it was built

Installation

pnpm dlx shadcn@latest add @ai2/skeleton-avatar

Requires @ai2 in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { AvatarCircleSkeleton } from "@/components/ui/skeleton-avatar"export function Loading() {  return <AvatarCircleSkeleton size="md" />}
  • Show a loading placeholder for a user row, comment, or profile card while avatar and name data is fetched.
  • Use StackSkeleton as a placeholder for avatar groups or member lists, with count controlling how many rows appear.
  • Use InlineSkeleton for a small avatar followed by a name, such as mentions, author tags, or assignee chips.
  • Use DetailSkeleton for a profile header while a large avatar, name, meta line, and bio load.

Examples

Comment list placeholder

A stack of three round-avatar rows shown while comments load.

comment-list-placeholder.tsx
import { StackSkeleton } from "@/components/ui/skeleton-avatar"export function CommentsLoading() {  return <StackSkeleton size="sm" count={4} className="p-4" />}

Inline author tag

A small inline placeholder for an author name inside a sentence.

inline-author-tag.tsx
import { InlineSkeleton } from "@/components/ui/skeleton-avatar"export function AuthorLoading() {  return (    <p className="text-sm">\n      Posted by <InlineSkeleton size="sm" />\n    </p>  )}

Profile header placeholder

A large detail skeleton for a profile page while the user record loads.

profile-header-placeholder.tsx
import { DetailSkeleton } from "@/components/ui/skeleton-avatar"export function ProfileLoading() {  return (    <section className="max-w-xl">      <DetailSkeleton size="lg" />    </section>  )}

API reference

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl""md"Scales the avatar, text bars, and gaps. Exported as StyledSize. Applies to all five components.
countnumber3Number of avatar rows rendered. Only available on StackSkeleton.
classNamestring—Additional classes merged onto the root element with cn(). Applies to all five components.
...propsReact.ComponentProps<"div">—All other div attributes are spread onto the root element. Applies to all five components. Note that aria-hidden and data-slot are set by the component and are overwritten if passed in props.

Accessibility

  • The root element of every skeleton has aria-hidden="true", so screen readers skip the placeholder and do not announce it as content.
  • Because the skeletons are hidden, pair them with a visible or announced loading state (for example, an aria-busy container or a status message) so users know content is loading.
  • The pulse animation is disabled when the user has enabled reduced motion (useReducedMotion), leaving static placeholders.
  • Colour comes only from design tokens (bg-secondary), so contrast follows the theme rather than hard-coded values.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Avatar skeleton" component (ai2/skeleton-avatar) from its shadcn registry.1. Install it with: npx shadcn@latest add @ai2/skeleton-avatar2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, count, className, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { AvatarCircleSkeleton } from "@/components/ui/skeleton-avatar"export function Loading() {  return <AvatarCircleSkeleton size="md" />}```

Files & dependencies

  • registry/ai2/styled/skeleton-avatar.tsx→ components/ui/skeleton-avatar.tsx
dependenciesmotion@^12.42.2
registryDependencies@ai2/tokens

Looks similar, elsewhere