Display
Hidden Count
A disclosure with a hidden-item count: the first people show in the header, the rest hide behind a +N circle.
- collapsible
- avatars
- counter
- details
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/collapsible-006?lang=en
Project membersАКБРВИ+5
- ГМГлеб Мостовой
- ДСДина Салих
- ЕПЕгор Панин
- ЖТЖанна Тур
- ЗЛЗахар Лемешев
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 "collapsible-006" (Hidden Count) 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/collapsible-006.json
Registry item: https://vibeui.ru/r/collapsible-006.json
Installs to: components/vibeui/collapsible-006.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 disclosure with a hidden-item count: the first people show in the header, the rest hide behind a +N circle.
A disclosure that shows how much is hidden right in the header: a stack of initials plus a +N circle, with the full remainder inside. No client JS. Zero dependencies, one file.
## 3. How to use it
import { Collapsible006 } from "@/components/vibeui/collapsible-006"
<Collapsible006 title="Project members" people={["Anna Kim", "Boris Radov"]} visible={3} />
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-collapsible-006-* palette — do not swap it for your theme tokens
- the hidden count in the header: without a number there is no reason to expand
- initials instead of pictures — the component must work without loading avatars
- the background-coloured ring on each circle: it is what creates the overlap
- the aria-label on the +N circle: on its own it reads as a meaningless number
- the light card surface — dark text is invisible on a dark showcase without it
## 6. You may change
- the heading through the title prop
- the people list
- how many names stay visible through the visible prop
- the accent through the accent prop and the circle size
## 7. Rules
- Only hidden people are listed inside: the visible ones are already in the header.
- When visible exceeds the list length the +N circle and the expansion disappear — that is intended.
- Initials come from the first two words of the name: a single word yields one letter.
- 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/collapsible-006.jsonhttps://vibeui.ru/r/collapsible-006.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-collapsible-006-*. Серверный: хуков нет, корень — details. Массив people делится пропсом visible на видимую и скрытую части, размер скрытой части и есть подпись кружка «+N». Стек аватаров собран отрицательным margin-left и рамкой цвета фона, инициалы вычисляются из имени, поэтому картинки не нужны. Кружок счётчика в раскрытом состоянии меняет цвет через селектор [open].
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 Collapsible006Props = Omit<
ComponentPropsWithoutRef<"details">,
"children" | "title"
> & {
title?: string
people?: string[]
visible?: number
accent?: string
}
// Идея компонента: свёртка, у которой в заголовке видно, сколько скрыто.
// Список участников почти всегда длиннее места, но «показать ещё» без числа
// не отвечает на главный вопрос — стоит ли разворачивать. Первые несколько
// имён остаются на виду, остальные сворачиваются в кружок «+N», и он же
// служит счётчиком. Инициалы берутся из имени, аватарки не нужны.
const STYLES = `
:where([data-vibeui-block="collapsible-006"]){
--vibeui-collapsible-006-bg:oklch(1 0 0);
--vibeui-collapsible-006-fg:oklch(0.24 0.014 265);
--vibeui-collapsible-006-muted:oklch(0.56 0.014 265);
--vibeui-collapsible-006-border:oklch(0.9 0.006 265);
--vibeui-collapsible-006-accent:oklch(0.55 0.17 240);
--vibeui-collapsible-006-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="collapsible-006"]{
display:block;box-sizing:border-box;width:100%;max-width:23rem;
background:var(--vibeui-collapsible-006-bg);color:var(--vibeui-collapsible-006-fg);
border:1px solid var(--vibeui-collapsible-006-border);border-radius:1rem;
font-family:var(--vibeui-collapsible-006-font);
}
[data-vibeui-block="collapsible-006"] summary{
display:flex;align-items:center;gap:0.75rem;
padding:0.8125rem 0.875rem;cursor:pointer;list-style:none;border-radius:1rem;
font-size:0.875rem;font-weight:650;
}
[data-vibeui-block="collapsible-006"] summary::-webkit-details-marker{display:none}
[data-vibeui-block="collapsible-006"] summary:focus-visible{outline:2px solid var(--vibeui-collapsible-006-accent);outline-offset:-2px}
[data-vibeui-block="collapsible-006"] [data-part="stack"]{
display:flex;margin-left:auto;padding-left:0.375rem;
}
[data-vibeui-block="collapsible-006"] [data-part="chip"]{
display:grid;place-items:center;
width:1.625rem;height:1.625rem;margin-left:-0.375rem;box-sizing:border-box;
border-radius:9999px;border:2px solid var(--vibeui-collapsible-006-bg);
background:color-mix(in oklab,var(--vibeui-collapsible-006-accent) 16%,oklch(1 0 0));
color:var(--vibeui-collapsible-006-accent);
font-size:0.625rem;font-weight:750;letter-spacing:0.01em;
}
/* Счётчик скрытых — это и есть ответ на вопрос «разворачивать ли». */
[data-vibeui-block="collapsible-006"] [data-part="chip"][data-rest="true"]{
background:var(--vibeui-collapsible-006-accent);color:oklch(1 0 0);
}
[data-vibeui-block="collapsible-006"][open] [data-part="chip"][data-rest="true"]{
background:var(--vibeui-collapsible-006-fg);
}
[data-vibeui-block="collapsible-006"] [data-part="list"]{
list-style:none;margin:0;padding:0.5rem 0.5rem 0.625rem;
border-top:1px solid var(--vibeui-collapsible-006-border);
display:flex;flex-direction:column;
}
[data-vibeui-block="collapsible-006"] [data-part="list"] li{
display:flex;align-items:center;gap:0.625rem;
padding:0.3125rem 0.375rem;border-radius:0.5rem;
font-size:0.8125rem;color:var(--vibeui-collapsible-006-muted);
}
[data-vibeui-block="collapsible-006"] [data-part="list"] li [data-part="chip"]{margin-left:0;border-color:transparent}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="collapsible-006"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_PEOPLE = [
"Анна Ким",
"Борис Радов",
"Вера Ильина",
"Глеб Мостовой",
"Дина Салих",
"Егор Панин",
"Жанна Тур",
"Захар Лемешев",
]
function initials(name: string) {
return name
.split(" ")
.slice(0, 2)
.map((part) => part.charAt(0).toUpperCase())
.join("")
}
/**
* Свёртка с подсчётом скрытых: первые участники на виду, остальные — за
* кружком «+N». Один файл, ноль зависимостей, клиентского кода нет.
*/
export function Collapsible006({
title = "Участники проекта",
people = DEFAULT_PEOPLE,
visible = 3,
accent,
className,
style,
...props
}: Collapsible006Props) {
const shown = people.slice(0, Math.max(0, visible))
const hidden = people.slice(shown.length)
const palette = {
...(accent ? { "--vibeui-collapsible-006-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-collapsible-006" precedence="medium">
{STYLES}
</style>
<details
{...props}
data-vibeui-block="collapsible-006"
className={className}
style={palette}
>
<summary>
{title}
<span data-part="stack">
{shown.map((person) => (
<span key={person} data-part="chip" title={person}>
{initials(person)}
</span>
))}
{hidden.length > 0 ? (
<span
data-part="chip"
data-rest="true"
aria-label={`Ещё ${hidden.length} участников`}
>
+{hidden.length}
</span>
) : null}
</span>
</summary>
{hidden.length > 0 ? (
<ul data-part="list">
{hidden.map((person) => (
<li key={person}>
<span data-part="chip">{initials(person)}</span>
{person}
</li>
))}
</ul>
) : null}
</details>
</>
)
}