Display

Vertical Avatar Stack

A vertical member stack for a narrow column: it grows downwards and takes the width of a single circle instead of breaking the sidebar with a horizontal row.

  • iconstack
  • vertical
  • sidebar
  • avatars

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/iconstack-004?lang=en

4 on shift
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 "iconstack-004" (Vertical Avatar Stack) 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/iconstack-004.json

Registry item: https://vibeui.ru/r/iconstack-004.json
Installs to: components/vibeui/iconstack-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 vertical member stack for a narrow column: it grows downwards and takes the width of a single circle instead of breaking the sidebar with a horizontal row.

A vertical member stack: overlap through column-reverse and a counted caption below. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Iconstack004 } from "@/components/vibeui/iconstack-004"

<Iconstack004
  names={["Anna Rebrova", "Ilya Mokhov", "Kim Son"]}
  size="md"
  label="on shift"
/>

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-iconstack-004-* palette — do not swap it for your theme tokens
- column-reverse instead of z-index: the upper circle lands above the lower one on its own
- tying size and overlap to one pair of variables — otherwise the stack falls apart at lg
- aria-hidden on the circles: initials mean nothing aloud, the caption carries the meaning
- the counted caption: three circles do not tell how many people are in the group
- the component's own light surface: the caption is dark and vanishes on a dark catalog background

## 6. You may change
- the circle size through size: sm, md or lg
- the caption under the stack through label
- the group roster through names
- the overlap through the --vibeui-iconstack-004-overlap variable

## 7. Rules
- A vertical stack is taller than a horizontal one: more than six circles break the column.
- Initials come from the first two words of the name: single-word handles yield one letter.
- The hue is derived from a hash of the name — renaming a member changes the circle colour.
- 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/iconstack-004.json
https://vibeui.ru/r/iconstack-004.json

Серверный компонент, хуков нет. Перекрытие собрано column-reverse и отрицательным margin-bottom, поэтому верхний кружок ложится поверх нижнего без z-index, а первое имя списка остаётся первым сверху — порядок чтения совпадает с порядком данных. Размер и величина перекрытия связаны одной парой переменных и переключаются атрибутом data-size, так что sm, md и lg сохраняют одинаковую плотность. Кружки декоративны и помечены aria-hidden: смысл несёт подпись с числом. Подложка светлая, поскольку подпись тёмная.

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 Iconstack004Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  names?: string[]
  size?: "sm" | "md" | "lg"
  label?: string
}

// Идея компонента: вертикальная стопка для узкой колонки. Горизонтальная
// стопка в сайдбаре шириной 4rem либо обрезается, либо ломает раскладку, а
// вертикальная растёт вниз и занимает ту же ширину, что один кружок.
// Порядок наложения задан column-reverse: верхний кружок ложится поверх
// нижнего без z-index, а первое имя списка остаётся первым сверху.
const STYLES = `
:where([data-vibeui-block="iconstack-004"]){
--vibeui-iconstack-004-size:2.25rem;
--vibeui-iconstack-004-overlap:0.75rem;
--vibeui-iconstack-004-surface:oklch(1 0 0);
--vibeui-iconstack-004-border:oklch(0.9 0.006 265);
--vibeui-iconstack-004-fg:oklch(0.26 0.014 265);
--vibeui-iconstack-004-muted:oklch(0.55 0.014 265);
--vibeui-iconstack-004-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: подпись под стопкой тёмная. */
[data-vibeui-block="iconstack-004"]{
display:inline-flex;flex-direction:column;align-items:center;gap:0.625rem;
box-sizing:border-box;padding:0.875rem 0.75rem;
background:var(--vibeui-iconstack-004-surface);
border:1px solid var(--vibeui-iconstack-004-border);border-radius:0.875rem;
font-family:var(--vibeui-iconstack-004-font);color:var(--vibeui-iconstack-004-fg);
}
/* column-reverse: верхний кружок ложится поверх нижнего без z-index. */
[data-vibeui-block="iconstack-004"] [data-part="stack"]{
display:inline-flex;flex-direction:column-reverse;justify-content:flex-end;
}
[data-vibeui-block="iconstack-004"] [data-part="stack"] > *{
margin-bottom:calc(var(--vibeui-iconstack-004-overlap) * -1);
}
[data-vibeui-block="iconstack-004"] [data-part="stack"] > *:first-child{margin-bottom:0}
[data-vibeui-block="iconstack-004"] [data-part="face"]{
display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;
width:var(--vibeui-iconstack-004-size);height:var(--vibeui-iconstack-004-size);
border-radius:9999px;border:2px solid var(--vibeui-iconstack-004-surface);
background:oklch(0.9 0.06 var(--vibeui-iconstack-004-hue,265));
color:oklch(0.36 0.12 var(--vibeui-iconstack-004-hue,265));
font-size:calc(var(--vibeui-iconstack-004-size) * 0.34);
font-weight:700;line-height:1;
}
[data-vibeui-block="iconstack-004"] [data-part="label"]{
max-width:6rem;text-align:center;
font-size:0.75rem;line-height:1.3;color:var(--vibeui-iconstack-004-muted);
}
[data-vibeui-block="iconstack-004"] [data-part="count"]{
font-weight:700;color:var(--vibeui-iconstack-004-fg);
font-variant-numeric:tabular-nums;
}
[data-vibeui-block="iconstack-004"][data-size="sm"]{--vibeui-iconstack-004-size:1.75rem;--vibeui-iconstack-004-overlap:0.5625rem}
[data-vibeui-block="iconstack-004"][data-size="lg"]{--vibeui-iconstack-004-size:2.75rem;--vibeui-iconstack-004-overlap:0.9375rem}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="iconstack-004"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_NAMES = ["Анна Реброва", "Илья Мохов", "Ким Сон", "Пётр Гай"]

function hue(name: string) {
  let hash = 2166136261
  for (const symbol of name) {
    hash ^= symbol.codePointAt(0)!
    hash = Math.imul(hash, 16777619)
  }
  return ((hash >>> 0) % 12) * 30
}

function initials(name: string) {
  return name
    .split(" ")
    .slice(0, 2)
    .map((part) => part.charAt(0).toUpperCase())
    .join("")
}

/**
 * Вертикальная стопка участников для узкой колонки.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Iconstack004({
  names = DEFAULT_NAMES,
  size = "md",
  label = "на смене",
  className,
  style,
  ...props
}: Iconstack004Props) {
  return (
    <>
      <style href="vibeui-iconstack-004" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="iconstack-004"
        data-size={size}
        className={className}
        style={style as CSSProperties}
      >
        <span data-part="stack" aria-hidden="true">
          {[...names].reverse().map((name) => (
            <span
              key={name}
              data-part="face"
              style={
                { "--vibeui-iconstack-004-hue": hue(name) } as CSSProperties
              }
            >
              {initials(name)}
            </span>
          ))}
        </span>
        <span data-part="label">
          <span data-part="count">{names.length}</span> {label}
        </span>
      </div>
    </>
  )
}