Display
Row Counted Panel
An area whose height is expressed in visible rows rather than pixels: the cut always lands on a row boundary, and the "6 of 12 visible" caption never lies.
- scrollarea
- counter
- list
- 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/scrollarea-005?lang=en
- Сборка 4821 · успешно
- Сборка 4820 · успешно
- Сборка 4819 · упала на тестах
- Сборка 4818 · успешно
- Сборка 4817 · отменена
- Сборка 4816 · успешно
- Сборка 4815 · успешно
- Сборка 4814 · упала на линтере
- Сборка 4813 · успешно
- Сборка 4812 · успешно
- Сборка 4811 · успешно
- Сборка 4810 · отменена
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 "scrollarea-005" (Row Counted Panel) 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/scrollarea-005.json
Registry item: https://vibeui.ru/r/scrollarea-005.json
Installs to: components/vibeui/scrollarea-005.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
An area whose height is expressed in visible rows rather than pixels: the cut always lands on a row boundary, and the "6 of 12 visible" caption never lies.
A fixed-height area measured in rows, with a capacity counter and numbering from a CSS counter. Zero dependencies, one file, server rendered.
## 3. How to use it
import { Scrollarea005 } from "@/components/vibeui/scrollarea-005"
<Scrollarea005 title="Build history" items={["Build 4821 · passed"]} rows={6} />
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-scrollarea-005-* palette — do not swap it for your theme tokens
- the height as row × row count: in pixels the cut lands mid-row
- the fixed row height — a fluid one breaks the calculation
- the CSS counter numbering: numbers in markup would need renumbering on every sort
- tabindex="0" and role="region" with aria-label on the scroller
- its own light surface: without it the dark text disappears on a dark background
## 6. You may change
- the heading through title
- the contents through items
- the visible row count through rows
- the row height through the step variable
## 7. Rules
- rows is clamped by the item count: a list of three will not grow to six rows tall.
- Multiline item text breaks the calculation: rows must stay single-line.
- The footer counter is static — it reports capacity, it does not track scrolling.
- 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/scrollarea-005.jsonhttps://vibeui.ru/r/scrollarea-005.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-scrollarea-005-*. Серверный: хуков нет. Высота считается как строка × число строк из двух переменных, поэтому нижняя граница области совпадает с границей строки и полустрока не появляется. Нумерация рисуется CSS-счётчиком в псевдоэлементе: в разметке номеров нет, и при смене порядка список не надо перенумеровывать руками. Прокручиваемый узел получает tabindex="0" и role="region" с aria-label. В подвале стоит честное «видно N из M», где N зажат числом элементов: если строк меньше, чем помещается, подпись не обещает лишнего.
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 Scrollarea005Props = Omit<
ComponentPropsWithoutRef<"div">,
"children" | "title"
> & {
title?: string
items?: string[]
/** Сколько строк видно без прокрутки: из них и считается высота области. */
rows?: number
}
// Идея компонента: высота области задана не пикселями, а числом видимых
// строк — высота строки и число строк перемножаются в одной переменной.
// Поэтому обрезка всегда приходится на границу строки, а не на её середину,
// и подпись «видно 6 из 18» не врёт. Номера рисует CSS-счётчик: в разметке
// их нет, и при смене порядка список не надо перенумеровывать руками.
const STYLES = `
:where([data-vibeui-block="scrollarea-005"]){
--vibeui-scrollarea-005-bg:oklch(1 0 0);
--vibeui-scrollarea-005-fg:oklch(0.24 0.014 265);
--vibeui-scrollarea-005-muted:oklch(0.55 0.014 265);
--vibeui-scrollarea-005-border:oklch(0.9 0.006 265);
--vibeui-scrollarea-005-accent:oklch(0.55 0.17 265);
--vibeui-scrollarea-005-row:2.25rem;
--vibeui-scrollarea-005-rows:6;
--vibeui-scrollarea-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="scrollarea-005"]{
display:flex;flex-direction:column;
width:100%;max-width:21rem;box-sizing:border-box;overflow:hidden;
background:var(--vibeui-scrollarea-005-bg);
border:1px solid var(--vibeui-scrollarea-005-border);border-radius:0.875rem;
font-family:var(--vibeui-scrollarea-005-font);color:var(--vibeui-scrollarea-005-fg);
}
[data-vibeui-block="scrollarea-005"] [data-part="head"],
[data-vibeui-block="scrollarea-005"] [data-part="foot"]{
display:flex;align-items:center;justify-content:space-between;gap:0.75rem;
padding:0.5625rem 0.875rem;font-size:0.75rem;
}
[data-vibeui-block="scrollarea-005"] [data-part="head"]{
border-bottom:1px solid var(--vibeui-scrollarea-005-border);
font-size:0.8125rem;font-weight:650;
}
[data-vibeui-block="scrollarea-005"] [data-part="foot"]{
border-top:1px solid var(--vibeui-scrollarea-005-border);
color:var(--vibeui-scrollarea-005-muted);font-variant-numeric:tabular-nums;
}
/* Высота = строка × число строк: обрезка всегда на границе строки. */
[data-vibeui-block="scrollarea-005"] [data-part="area"]{
height:calc(var(--vibeui-scrollarea-005-row) * var(--vibeui-scrollarea-005-rows));
overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;
}
[data-vibeui-block="scrollarea-005"] [data-part="area"]:focus-visible{
outline:2px solid var(--vibeui-scrollarea-005-accent);outline-offset:-2px;
}
[data-vibeui-block="scrollarea-005"] ol{
margin:0;padding:0;list-style:none;counter-reset:vibeui-scrollarea-005-row;
}
[data-vibeui-block="scrollarea-005"] li{
display:flex;align-items:center;gap:0.625rem;
box-sizing:border-box;height:var(--vibeui-scrollarea-005-row);
padding:0 0.875rem;font-size:0.8125rem;
counter-increment:vibeui-scrollarea-005-row;
}
[data-vibeui-block="scrollarea-005"] li + li{border-top:1px solid oklch(0.955 0.004 265)}
/* Номера рисует счётчик: в разметке их нет и перенумеровывать нечего. */
[data-vibeui-block="scrollarea-005"] li::before{
content:counter(vibeui-scrollarea-005-row);
flex:none;min-width:1.25rem;
color:var(--vibeui-scrollarea-005-muted);
font-size:0.6875rem;font-variant-numeric:tabular-nums;text-align:right;
}
[data-vibeui-block="scrollarea-005"] li span{
overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="scrollarea-005"] *{animation:none!important;transition:none!important}
}
`
const DEFAULT_ITEMS = [
"Сборка 4821 · успешно",
"Сборка 4820 · успешно",
"Сборка 4819 · упала на тестах",
"Сборка 4818 · успешно",
"Сборка 4817 · отменена",
"Сборка 4816 · успешно",
"Сборка 4815 · успешно",
"Сборка 4814 · упала на линтере",
"Сборка 4813 · успешно",
"Сборка 4812 · успешно",
"Сборка 4811 · успешно",
"Сборка 4810 · отменена",
]
/**
* Область фиксированной высоты в строках, с нумерацией от CSS-счётчика.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Scrollarea005({
title = "История сборок",
items = DEFAULT_ITEMS,
rows = 6,
className,
style,
...props
}: Scrollarea005Props) {
const visible = Math.min(items.length, Math.max(1, rows))
const palette = {
"--vibeui-scrollarea-005-rows": visible,
...style,
} as CSSProperties
return (
<>
<style href="vibeui-scrollarea-005" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="scrollarea-005"
className={className}
style={palette}
>
<div data-part="head">
<span>{title}</span>
<span>{items.length}</span>
</div>
<div data-part="area" tabIndex={0} role="region" aria-label={title}>
<ol>
{items.map((item) => (
<li key={item}>
<span>{item}</span>
</li>
))}
</ol>
</div>
<div data-part="foot">
<span>
видно {visible} из {items.length}
</span>
<span>прокрутите список</span>
</div>
</div>
</>
)
}