Display

Card Skeleton

A card skeleton that mirrors the whole frame: a cover with a fixed aspect ratio, a heading, two text lines and a row of buttons — the height does not change when the data lands.

  • skeleton
  • card
  • loading
  • display

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/skeleton-002?lang=en

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "skeleton-002" (Card Skeleton) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/skeleton-002.json

Registry item: https://vibeui.ru/r/skeleton-002.json
Installs to: components/vibeui/skeleton-002.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A card skeleton that mirrors the whole frame: a cover with a fixed aspect ratio, a heading, two text lines and a row of buttons — the height does not change when the data lands.

A card skeleton: the cover reserves its space by aspect ratio, followed by heading, text and buttons. Zero dependencies, one file, server rendered.

## 3. How to use it
import { Skeleton002 } from "@/components/vibeui/skeleton-002"

<Skeleton002 ratio="16 / 9" label="Card is loading" />

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-skeleton-002-* palette — do not swap it for your theme tokens
- aspect-ratio for the cover instead of a fixed height: otherwise the grid jumps when the image lands
- role="status" and aria-busy on the root — without them the skeleton is silent to screen readers
- the shared fill rule for every part: separate rules let the shimmer drift apart
- the prefers-reduced-motion rule that flattens the shimmer to a plain fill
- the card's own light surface: on a dark gallery the grey bars are invisible otherwise

## 6. You may change
- the cover proportion through ratio
- the screen-reader caption through label
- the heading and text bar widths in CSS to match your typography
- the radii and paddings of the card to fit your system

## 7. Rules
- The skeleton must match the real card's metrics, otherwise it loses its point.
- Showing a skeleton for more than a second instead of answering instantly is worse than showing nothing.
- There is no text inside the skeleton: the caption lives only in aria-label.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/skeleton-002.json
https://vibeui.ru/r/skeleton-002.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-skeleton-002-*. Серверный: хуков нет. Место под обложку занято через aspect-ratio, а не фиксированной высотой, поэтому карточка держит одну и ту же высоту при любой ширине колонки и соседи по сетке не прыгают. Заливка объявлена одним правилом сразу для обложки, полос и кнопок: блик и база не могут разойтись между частями. Блик едет background-position, а не transform, — элементы остаются на своих местах. Корень помечен role="status" и aria-busy, поэтому вспомогательные технологии сообщают о загрузке, а не читают пустые прямоугольники.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Skeleton002Props = ComponentPropsWithoutRef<"div"> & {
  /** Пропорция медиа-места: карточка держит его до загрузки картинки. */
  ratio?: "16 / 9" | "4 / 3" | "1 / 1"
  label?: string
}

// Идея компонента: заглушка карточки повторяет её каркас целиком — обложку с
// заданной пропорцией, заголовок, две строки текста и ряд кнопок. Место под
// обложку занято через aspect-ratio, поэтому при подстановке картинки высота
// карточки не меняется и соседи по сетке не прыгают.
const STYLES = `
:where([data-vibeui-block="skeleton-002"]){
--vibeui-skeleton-002-bg:oklch(1 0 0);
--vibeui-skeleton-002-border:oklch(0.9 0.006 265);
--vibeui-skeleton-002-base:oklch(0.93 0.005 265);
--vibeui-skeleton-002-shine:oklch(0.97 0.003 265);
--vibeui-skeleton-002-ratio:16 / 9;
}
[data-vibeui-block="skeleton-002"]{
display:flex;flex-direction:column;
width:100%;max-width:20rem;box-sizing:border-box;overflow:hidden;
background:var(--vibeui-skeleton-002-bg);
border:1px solid var(--vibeui-skeleton-002-border);border-radius:1rem;
}
/* Один рецепт заливки на все формы: блик и база не расходятся между частями. */
[data-vibeui-block="skeleton-002"] [data-part="media"],
[data-vibeui-block="skeleton-002"] [data-part="bar"],
[data-vibeui-block="skeleton-002"] [data-part="pill"]{
background:linear-gradient(90deg,
var(--vibeui-skeleton-002-base) 0%,
var(--vibeui-skeleton-002-shine) 50%,
var(--vibeui-skeleton-002-base) 100%) 0 0 / 200% 100%;
animation:vibeui-skeleton-002-sweep 1.4s ease-in-out infinite;
}
/* Место под обложку занято пропорцией: подстановка картинки не двигает сетку. */
[data-vibeui-block="skeleton-002"] [data-part="media"]{
aspect-ratio:var(--vibeui-skeleton-002-ratio);width:100%;
}
[data-vibeui-block="skeleton-002"] [data-part="body"]{
display:flex;flex-direction:column;gap:0.625rem;padding:0.9375rem 1rem 1.0625rem;
}
[data-vibeui-block="skeleton-002"] [data-part="bar"]{height:0.75rem;border-radius:0.25rem}
[data-vibeui-block="skeleton-002"] [data-part="bar"][data-size="title"]{height:1.0625rem;width:72%;border-radius:0.3125rem}
[data-vibeui-block="skeleton-002"] [data-part="bar"][data-size="short"]{width:54%}
[data-vibeui-block="skeleton-002"] [data-part="actions"]{
display:flex;gap:0.5rem;margin-top:0.25rem;
}
[data-vibeui-block="skeleton-002"] [data-part="pill"]{
height:2rem;border-radius:9999px;flex:1 1 0;
}
[data-vibeui-block="skeleton-002"] [data-part="pill"][data-size="icon"]{flex:none;width:2rem}
@keyframes vibeui-skeleton-002-sweep{
0%{background-position:120% 0}
100%{background-position:-20% 0}
}
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="skeleton-002"] *{animation:none!important;transition:none!important}
[data-vibeui-block="skeleton-002"] [data-part="media"],
[data-vibeui-block="skeleton-002"] [data-part="bar"],
[data-vibeui-block="skeleton-002"] [data-part="pill"]{background:var(--vibeui-skeleton-002-base)}
}
`

/**
 * Заглушка карточки: обложка с пропорцией, заголовок, текст и кнопки.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Skeleton002({
  ratio = "16 / 9",
  label = "Карточка загружается",
  className,
  style,
  ...props
}: Skeleton002Props) {
  const palette = {
    "--vibeui-skeleton-002-ratio": ratio,
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-skeleton-002" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="skeleton-002"
        role="status"
        aria-busy="true"
        aria-label={label}
        className={className}
        style={palette}
      >
        <div data-part="media" />
        <div data-part="body">
          <div data-part="bar" data-size="title" />
          <div data-part="bar" />
          <div data-part="bar" data-size="short" />
          <div data-part="actions">
            <div data-part="pill" />
            <div data-part="pill" data-size="icon" />
          </div>
        </div>
      </div>
    </>
  )
}