Avatar

Avatar Grid

A grid of faces instead of a stack: the whole team is visible, and the browser works out the column count through auto-fill.

  • avatar
  • grid
  • team
  • roster

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/avatar-016?lang=en

On the project · 8

  • Анна Реброва
  • Илья Мохов
  • Ким Сон
  • Пётр Гай
  • Мария Лоза
  • Олег Дин
  • Вера Найт
  • Тимур Аль
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 "avatar-016" (Avatar Grid) 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/avatar-016.json

Registry item: https://vibeui.ru/r/avatar-016.json
Installs to: components/vibeui/avatar-016.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 grid of faces instead of a stack: the whole team is visible, and the browser works out the column count through auto-fill.

A grid of captioned faces: the whole team stays visible and the browser works out the columns through auto-fill. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Avatar016 } from "@/components/vibeui/avatar-016"

<Avatar016
  title="On the project"
  names={["Anna Rebrova", "Ilya Mokhov", "Kim Son", "Pyotr Gai"]}
/>

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-avatar-016-* palette — do not swap it for your theme tokens
- auto-fill with minmax instead of a fixed column count — the rows must reflow on their own
- the captions under the faces: circles never answer who is on the team
- ellipsis truncation instead of a hover tooltip — phones have none
- deriving the hue from the name: one person must keep one colour across lists
- the card's own light surface: without it the dark text disappears on a dark background

## 6. You may change
- the names array and the title
- the minimum cell width in grid-template-columns
- the face size through the size variable
- the card width through max-width

## 7. Rules
- The grid does not cap the list: trim a long roster in the caller and offer a "show all" link.
- The list key is the name: pass an id and change the key when full namesakes are possible.
- The header count reflects the passed array, not the total member count.
- 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/avatar-016.json
https://vibeui.ru/r/avatar-016.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-avatar-016-*. Серверный: хуков нет. Колонки заданы repeat(auto-fill, minmax(4.5rem, 1fr)), поэтому их число считает браузер по фактической ширине, а не пропс: при смене ширины ряды перестраиваются сами. Оттенок кружка выводится из имени функцией FNV-1a, поэтому один человек всегда одного цвета. Имена подписаны под лицами и режутся многоточием — обрезанное имя честнее подсказки, которая не появляется на телефоне.

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 Avatar016Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  names?: string[]
  title?: string
  columns?: number
}

// Идея компонента: сетка лиц вместо стопки. Стопка экономит место, но прячет
// людей друг за другом; сетка нужна там, где важен состав, а не факт «их
// несколько». Ячейка задана auto-fill с minmax, поэтому число колонок считает
// браузер, а не пропс: при смене ширины ряды перестраиваются сами. Имена
// подписаны под лицами и обрезаются многоточием — обрезанное имя честнее
// подсказки, которая не появляется на телефоне.
const STYLES = `
:where([data-vibeui-block="avatar-016"]){
--vibeui-avatar-016-size:3rem;
--vibeui-avatar-016-bg:oklch(1 0 0);
--vibeui-avatar-016-fg:oklch(0.24 0.014 265);
--vibeui-avatar-016-muted:oklch(0.55 0.014 265);
--vibeui-avatar-016-border:oklch(0.91 0.006 265);
--vibeui-avatar-016-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
container-type:inline-size;
}
[data-vibeui-block="avatar-016"]{
box-sizing:border-box;width:100%;max-width:26rem;padding:0.875rem;
background:var(--vibeui-avatar-016-bg);
border:1px solid var(--vibeui-avatar-016-border);border-radius:0.875rem;
font-family:var(--vibeui-avatar-016-font);color:var(--vibeui-avatar-016-fg);
}
[data-vibeui-block="avatar-016"] *{box-sizing:border-box}
[data-vibeui-block="avatar-016"] h3{
margin:0 0 0.75rem;font-size:0.875rem;font-weight:650;
}
[data-vibeui-block="avatar-016"] [data-part="count"]{color:var(--vibeui-avatar-016-muted);font-weight:500}
/* auto-fill: число колонок считает браузер, ряды перестраиваются сами. */
[data-vibeui-block="avatar-016"] ul{
list-style:none;margin:0;padding:0;
display:grid;grid-template-columns:repeat(auto-fill,minmax(4.5rem,1fr));gap:0.75rem 0.5rem;
}
[data-vibeui-block="avatar-016"] li{
display:flex;flex-direction:column;align-items:center;gap:0.375rem;min-width:0;
}
[data-vibeui-block="avatar-016"] [data-part="face"]{
display:grid;place-items:center;flex:none;
width:var(--vibeui-avatar-016-size);height:var(--vibeui-avatar-016-size);
border-radius:9999px;
background:oklch(0.9 0.06 var(--vibeui-avatar-016-hue,265));
color:oklch(0.36 0.12 var(--vibeui-avatar-016-hue,265));
font-size:calc(var(--vibeui-avatar-016-size) * 0.34);font-weight:700;
}
/* Имя обрезается многоточием: подсказка не появляется на телефоне. */
[data-vibeui-block="avatar-016"] [data-part="name"]{
max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
font-size:0.6875rem;color:var(--vibeui-avatar-016-muted);text-align:center;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="avatar-016"] *{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 Avatar016({
  names = DEFAULT_NAMES,
  title = "В проекте",
  className,
  style,
  ...props
}: Avatar016Props) {
  return (
    <>
      <style href="vibeui-avatar-016" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="avatar-016"
        className={className}
        style={style as CSSProperties}
      >
        <h3>
          {title} <span data-part="count">· {names.length}</span>
        </h3>
        <ul>
          {names.map((name) => (
            <li key={name}>
              <span
                data-part="face"
                aria-hidden="true"
                style={
                  { "--vibeui-avatar-016-hue": hue(name) } as CSSProperties
                }
              >
                {initials(name)}
              </span>
              <span data-part="name">{name}</span>
            </li>
          ))}
        </ul>
      </div>
    </>
  )
}