Display
Table Skeleton
A table skeleton that holds the future column widths: the header and the rows share one grid-template-columns value, so nothing shifts when the data arrives.
- skeleton
- table
- grid
- display
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/skeleton-004?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-004" (Table 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-004.json
Registry item: https://vibeui.ru/r/skeleton-004.json
Installs to: components/vibeui/skeleton-004.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 table skeleton that holds the future column widths: the header and the rows share one grid-template-columns value, so nothing shifts when the data arrives.
A table skeleton: the header and rows share a single column-grid variable, and cells vary in length. Zero dependencies, one file, server rendered.
## 3. How to use it
import { Skeleton004 } from "@/components/vibeui/skeleton-004"
<Skeleton004
rows={5}
columns="1.5rem 2fr 1fr 1fr 4rem"
label="Table 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-004-* palette — do not swap it for your theme tokens
- one grid variable for header and rows: separate grids drift apart on the first edit
- the varying cell lengths — identical rectangles read as a lattice, not as data
- the distinguished header: without it the block is not recognisable as a table
- 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 cells are invisible otherwise
## 6. You may change
- the column layout through columns
- the row count through rows
- the screen-reader caption through label
- the row height and cell padding in CSS
## 7. Rules
- columns accepts any valid grid-template-columns value, but the markup is fixed at five columns.
- The widths must match the real table, otherwise the skeleton lies and the data jumps.
- The component draws no horizontal scrolling: wrap wide tables yourself.
- 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-004.jsonhttps://vibeui.ru/r/skeleton-004.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-skeleton-004-*. Серверный: хуков нет. Раскладка задана единственной переменной --vibeui-skeleton-004-columns, которую подхватывают и шапка, и все строки: колонки не могут разойтись, потому что у них буквально одна сетка. Длины ячеек чередуются атрибутом data-fill и правилами :nth-child, иначе заглушка читается как решётка. Шапка выделена фоном и нижней границей, поэтому таблица узнаётся до появления текста. Корень помечен role="status" и aria-busy; при prefers-reduced-motion блик снимается.
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 Skeleton004Props = ComponentPropsWithoutRef<"div"> & {
rows?: number
/** Раскладка колонок в терминах grid-template-columns. */
columns?: string
label?: string
}
// Идея компонента: заглушка таблицы обязана держать ширины колонок будущей
// таблицы, иначе при подстановке данных всё разъезжается. Ширины заданы одной
// переменной grid-template-columns, поэтому шапка и строки не могут разойтись:
// у них буквально одна и та же сетка.
const STYLES = `
:where([data-vibeui-block="skeleton-004"]){
--vibeui-skeleton-004-bg:oklch(1 0 0);
--vibeui-skeleton-004-head:oklch(0.975 0.003 265);
--vibeui-skeleton-004-border:oklch(0.9 0.006 265);
--vibeui-skeleton-004-base:oklch(0.93 0.005 265);
--vibeui-skeleton-004-shine:oklch(0.97 0.003 265);
--vibeui-skeleton-004-columns:1.5rem 2fr 1fr 1fr 4rem;
}
[data-vibeui-block="skeleton-004"]{
width:100%;max-width:32rem;box-sizing:border-box;overflow:hidden;
background:var(--vibeui-skeleton-004-bg);
border:1px solid var(--vibeui-skeleton-004-border);border-radius:0.875rem;
}
/* Одна сетка на шапку и на строки: колонки не могут разойтись. */
[data-vibeui-block="skeleton-004"] [data-part="row"]{
display:grid;grid-template-columns:var(--vibeui-skeleton-004-columns);
align-items:center;gap:0.75rem;padding:0.6875rem 0.875rem;
}
[data-vibeui-block="skeleton-004"] [data-part="row"][data-role="head"]{
background:var(--vibeui-skeleton-004-head);
border-bottom:1px solid var(--vibeui-skeleton-004-border);
}
[data-vibeui-block="skeleton-004"] [data-part="row"] + [data-part="row"]:not([data-role="head"]){
border-top:1px solid var(--vibeui-skeleton-004-border);
}
[data-vibeui-block="skeleton-004"] [data-part="cell"]{
height:0.6875rem;border-radius:0.25rem;
background:linear-gradient(90deg,
var(--vibeui-skeleton-004-base) 0%,
var(--vibeui-skeleton-004-shine) 50%,
var(--vibeui-skeleton-004-base) 100%) 0 0 / 200% 100%;
animation:vibeui-skeleton-004-sweep 1.5s ease-in-out infinite;
}
[data-vibeui-block="skeleton-004"] [data-role="head"] [data-part="cell"]{
height:0.5rem;opacity:.75;
}
/* Разная длина ячеек: одинаковые прямоугольники читаются как решётка. */
[data-vibeui-block="skeleton-004"] [data-part="cell"][data-fill="long"]{width:82%}
[data-vibeui-block="skeleton-004"] [data-part="cell"][data-fill="mid"]{width:64%}
[data-vibeui-block="skeleton-004"] [data-part="cell"][data-fill="short"]{width:46%}
[data-vibeui-block="skeleton-004"] [data-part="cell"][data-fill="box"]{
height:0.875rem;border-radius:0.1875rem;
}
[data-vibeui-block="skeleton-004"] [data-part="row"]:nth-child(even) [data-part="cell"][data-fill="long"]{width:66%}
[data-vibeui-block="skeleton-004"] [data-part="row"]:nth-child(3n) [data-part="cell"][data-fill="mid"]{width:48%}
@keyframes vibeui-skeleton-004-sweep{
0%{background-position:120% 0}
100%{background-position:-20% 0}
}
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="skeleton-004"] *{animation:none!important;transition:none!important}
[data-vibeui-block="skeleton-004"] [data-part="cell"]{background:var(--vibeui-skeleton-004-base)}
}
`
const FILLS = ["box", "long", "mid", "short", "short"] as const
/**
* Заглушка таблицы: шапка и строки на одной сетке колонок.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Skeleton004({
rows = 5,
columns = "1.5rem 2fr 1fr 1fr 4rem",
label = "Таблица загружается",
className,
style,
...props
}: Skeleton004Props) {
const count = Math.min(20, Math.max(1, rows))
const palette = {
"--vibeui-skeleton-004-columns": columns,
...style,
} as CSSProperties
return (
<>
<style href="vibeui-skeleton-004" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="skeleton-004"
role="status"
aria-busy="true"
aria-label={label}
className={className}
style={palette}
>
<div data-part="row" data-role="head">
{FILLS.map((fill, index) => (
<span key={index} data-part="cell" data-fill={fill} />
))}
</div>
{Array.from({ length: count }, (_, row) => (
<div key={row} data-part="row">
{FILLS.map((fill, index) => (
<span key={index} data-part="cell" data-fill={fill} />
))}
</div>
))}
</div>
</>
)
}