Display

Chart Skeleton

A bar chart skeleton with a fixed-height plot and grid lines: without the grid the grey bars read as a list rather than as a chart.

  • skeleton
  • chart
  • 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-008?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-008" (Chart 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-008.json

Registry item: https://vibeui.ru/r/skeleton-008.json
Installs to: components/vibeui/skeleton-008.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 bar chart skeleton with a fixed-height plot and grid lines: without the grid the grey bars read as a list rather than as a chart.

A chart skeleton: a fixed-height plot with grid lines, bars of varying height, a legend and axis ticks. Zero dependencies, one file, server rendered.

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

<Skeleton008 bars={[42, 68, 55, 88, 34, 72, 61]} height="8.5rem" label="Chart 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-008-* palette — do not swap it for your theme tokens
- the grid lines painted as the plot background: without them the block reads as a list
- the fixed bar heights instead of random ones — random values break hydration
- the fixed plot height: it is the promise that the chart will land in that exact space
- role="status" and aria-busy on the root, or the skeleton is silent to screen readers
- its own light surface: on a dark gallery the grey bars are invisible otherwise

## 6. You may change
- the bar silhouette through bars
- the plot height through height
- the screen-reader caption through label
- the grid line step in the background rule

## 7. Rules
- The axis tick count equals the bar count: both come from the same array.
- Bar heights are clamped to a minimum of four percent, otherwise a zero bar disappears entirely.
- This skeleton does not fit a line chart: there the silhouette is a curve, not rectangles.
- 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-008.json
https://vibeui.ru/r/skeleton-008.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-skeleton-008-*. Серверный: хуков нет. Поле графика держит высоту переменной, а линии сетки нарисованы repeating-linear-gradient на самом поле, поэтому отдельных элементов под них нет. Высоты столбиков заданы явным массивом и передаются каждому инлайновой переменной: случайные числа разъехались бы между сервером и клиентом при гидратации и React сообщил бы о несовпадении. Легенда сверху и подписи оси снизу занимают место заранее, поэтому появление настоящего графика не сдвигает соседний текст. Корень помечен 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 Skeleton008Props = ComponentPropsWithoutRef<"div"> & {
  /** Высоты столбиков в процентах от поля графика. */
  bars?: number[]
  height?: string
  label?: string
}

// Идея компонента: заглушка графика держит поле фиксированной высоты и рисует
// линии сетки — без них серые столбики читаются как список, а не как график.
// Высоты столбиков заданы явным массивом, а не случайными числами: случайные
// разъехались бы между сервером и клиентом при гидратации.
const STYLES = `
:where([data-vibeui-block="skeleton-008"]){
--vibeui-skeleton-008-bg:oklch(1 0 0);
--vibeui-skeleton-008-border:oklch(0.9 0.006 265);
--vibeui-skeleton-008-grid:oklch(0.94 0.004 265);
--vibeui-skeleton-008-base:oklch(0.93 0.005 265);
--vibeui-skeleton-008-shine:oklch(0.97 0.003 265);
--vibeui-skeleton-008-height:8.5rem;
--vibeui-skeleton-008-bar:0;
--vibeui-skeleton-008-delay:0s;
}
[data-vibeui-block="skeleton-008"]{
display:flex;flex-direction:column;gap:0.75rem;
width:100%;max-width:28rem;box-sizing:border-box;padding:1rem 1.125rem 1.125rem;
background:var(--vibeui-skeleton-008-bg);
border:1px solid var(--vibeui-skeleton-008-border);border-radius:1rem;
}
[data-vibeui-block="skeleton-008"] [data-part="legend"]{
display:flex;align-items:center;gap:0.5rem;
}
[data-vibeui-block="skeleton-008"] [data-part="chip"]{
width:2.75rem;height:0.625rem;border-radius:9999px;
}
[data-vibeui-block="skeleton-008"] [data-part="title"]{
width:38%;height:0.75rem;border-radius:0.25rem;
}
/* Линии сетки: без них столбики читаются как список, а не как график. */
[data-vibeui-block="skeleton-008"] [data-part="plot"]{
display:flex;align-items:flex-end;gap:0.5rem;
height:var(--vibeui-skeleton-008-height);
padding-bottom:1px;
background-image:repeating-linear-gradient(
to top,
var(--vibeui-skeleton-008-grid) 0 1px,
transparent 1px 25%);
}
[data-vibeui-block="skeleton-008"] [data-part="bar"]{
flex:1 1 0;border-radius:0.25rem 0.25rem 0 0;
height:calc(var(--vibeui-skeleton-008-bar) * 1%);
animation-delay:var(--vibeui-skeleton-008-delay);
}
[data-vibeui-block="skeleton-008"] [data-part="tick"]{
flex:1 1 0;height:0.5rem;border-radius:0.1875rem;
}
[data-vibeui-block="skeleton-008"] [data-part="axis"]{
display:flex;gap:0.5rem;padding-top:0.5rem;
border-top:1px solid var(--vibeui-skeleton-008-border);
}
[data-vibeui-block="skeleton-008"] [data-part="chip"],
[data-vibeui-block="skeleton-008"] [data-part="title"],
[data-vibeui-block="skeleton-008"] [data-part="bar"],
[data-vibeui-block="skeleton-008"] [data-part="tick"]{
background:linear-gradient(90deg,
var(--vibeui-skeleton-008-base) 0%,
var(--vibeui-skeleton-008-shine) 50%,
var(--vibeui-skeleton-008-base) 100%) 0 0 / 200% 100%;
animation:vibeui-skeleton-008-sweep 1.5s ease-in-out infinite;
}
@keyframes vibeui-skeleton-008-sweep{
0%{background-position:120% 0}
100%{background-position:-20% 0}
}
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="skeleton-008"] *{animation:none!important;transition:none!important}
[data-vibeui-block="skeleton-008"] [data-part="chip"],
[data-vibeui-block="skeleton-008"] [data-part="title"],
[data-vibeui-block="skeleton-008"] [data-part="bar"],
[data-vibeui-block="skeleton-008"] [data-part="tick"]{background:var(--vibeui-skeleton-008-base)}
}
`

const DEFAULT_BARS = [42, 68, 55, 88, 34, 72, 61]

/**
 * Заглушка столбчатого графика с полем, сеткой и подписями оси.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Skeleton008({
  bars = DEFAULT_BARS,
  height = "8.5rem",
  label = "График загружается",
  className,
  style,
  ...props
}: Skeleton008Props) {
  const palette = {
    "--vibeui-skeleton-008-height": height,
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-skeleton-008" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="skeleton-008"
        role="status"
        aria-busy="true"
        aria-label={label}
        className={className}
        style={palette}
      >
        <div data-part="legend">
          <span data-part="chip" />
          <span data-part="title" />
        </div>
        <div data-part="plot">
          {bars.map((value, index) => (
            <span
              key={index}
              data-part="bar"
              style={
                {
                  "--vibeui-skeleton-008-bar": Math.min(
                    100,
                    Math.max(4, value),
                  ),
                  "--vibeui-skeleton-008-delay": `${index * 0.07}s`,
                } as CSSProperties
              }
            />
          ))}
        </div>
        <div data-part="axis">
          {bars.map((_, index) => (
            <span key={index} data-part="tick" />
          ))}
        </div>
      </div>
    </>
  )
}