For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
43
Sponsor

Skeleton

Use to show a placeholder while content is loading.

import { Skeleton } from "@/components/ui/skeleton";

export function SkeletonDemo() {
  return (
    <div style={{ alignItems: "center", display: "flex", gap: 16 }}>
      <Skeleton style={{ borderRadius: "9999px", height: 48, width: 48 }} />

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.com/r/skeleton.json

Usage

import { Skeleton } from "@/components/ui/skeleton/skeleton";
<Skeleton style={{ width: 200, height: 16 }} />

Examples

Avatar

import { Skeleton } from "@/components/ui/skeleton";

export function SkeletonAvatar() {
  return (
    <div className="flex w-fit items-center gap-4">
      <Skeleton className="size-10 shrink-0 rounded-full" />

Card

Compose multiple skeletons to outline a loading card.

import { Skeleton } from "@/components/ui/skeleton";

export function SkeletonCard() {
  return (
    <div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
      <Skeleton style={{ borderRadius: 12, height: 160, width: 280 }} />

Text

import { Skeleton } from "@/components/ui/skeleton";

export function SkeletonText() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-2">
      <Skeleton className="h-4 w-full" />

Form

import { Skeleton } from "@/components/ui/skeleton";

export function SkeletonForm() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-7">
      <div className="flex flex-col gap-3">

Table

import { Skeleton } from "@/components/ui/skeleton";

const ROWS = ["a", "b", "c", "d", "e"];

export function SkeletonTable() {
  return (

RTL

To enable right-to-left support, see the RTL guide.

"use client";

import * as React from "react";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";