Card

Person Card

A person card: avatar, role, a row of figures and two actions; the bio is clamped to two lines so the grid stays even.

  • card
  • person
  • team
  • profile

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/card-003?lang=en

Maria Gurova

Product designer

Веду каталог и дизайн-систему, собираю интерфейсы, которые не приходится объяснять словами.

14Проектов3 годаВ команде2 чОтклик
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 "card-003" (Person Card) 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/card-003.json

Registry item: https://vibeui.ru/r/card-003.json
Installs to: components/vibeui/card-003.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 person card: avatar, role, a row of figures and two actions; the bio is clamped to two lines so the grid stays even.

A person card for a team list: name-derived initials, role, a short bio, a row of figures and two actions. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Card003 } from "@/components/vibeui/card-003"

<Card003 name="Maria Gurova" role="Designer" stats={[{ label: "Projects", value: "14" }]} />

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-card-003-* palette — do not swap it for your theme tokens
- clamping the bio to two lines: cards in a grid must share one height
- the figures in a row between rules — they get compared across cards
- the name-derived avatar hue: one person keeps one colour
- equal-width actions: primary and secondary must not shift about
- the visible focus ring on the buttons

## 6. You may change
- name, role and about
- the stats array
- actionLabel and secondaryLabel
- the accent through the accent prop

## 7. Rules
- More than three figures do not fit the row: the rest belong on the profile page.
- The buttons do nothing: handlers belong to the caller.
- If you have a photo, put an <img> inside the circle — the sizing is ready.
- 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/card-003.json
https://vibeui.ru/r/card-003.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-card-003-*. Серверный: хуков нет. Оттенок аватара считается из имени FNV-1a по двенадцати ступеням круга. Текст обрезается -webkit-line-clamp двумя строками, цифры вынесены в ряд между границами, действия занимают равную ширину.

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 Card003Props = Omit<
  ComponentPropsWithoutRef<"article">,
  "children" | "title"
> & {
  name?: string
  role?: string
  about?: string
  stats?: { label: string; value: string }[]
  actionLabel?: string
  secondaryLabel?: string
  accent?: string
}

// Идея компонента: карточка человека для команды и списка контактов. Цифры
// стоят в ряд под именем, потому что их сравнивают между карточками; текст
// «о себе» обрезан двумя строками — иначе карточки в сетке разной высоты и
// ряд рассыпается.
const STYLES = `
:where([data-vibeui-block="card-003"]){
--vibeui-card-003-bg:oklch(1 0 0);
--vibeui-card-003-fg:oklch(0.22 0.014 265);
--vibeui-card-003-muted:oklch(0.56 0.014 265);
--vibeui-card-003-border:oklch(0.91 0.006 265);
--vibeui-card-003-hue:250;
--vibeui-card-003-accent:oklch(0.55 0.17 265);
--vibeui-card-003-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="card-003"]{
display:flex;flex-direction:column;gap:0.625rem;
width:100%;max-width:17rem;box-sizing:border-box;padding:0.875rem;
background:var(--vibeui-card-003-bg);
border:1px solid var(--vibeui-card-003-border);border-radius:0.875rem;
color:var(--vibeui-card-003-fg);font-family:var(--vibeui-card-003-font);
}
[data-vibeui-block="card-003"] [data-part="head"]{display:flex;align-items:center;gap:0.625rem}
[data-vibeui-block="card-003"] [data-part="avatar"]{
display:flex;align-items:center;justify-content:center;flex:none;
width:2.75rem;height:2.75rem;border-radius:9999px;
background:oklch(0.92 0.05 var(--vibeui-card-003-hue));
color:oklch(0.38 0.09 var(--vibeui-card-003-hue));
font-size:0.9375rem;font-weight:700;
}
[data-vibeui-block="card-003"] [data-part="name"]{margin:0;font-size:0.9375rem;font-weight:650;line-height:1.25}
[data-vibeui-block="card-003"] [data-part="role"]{font-size:0.8125rem;color:var(--vibeui-card-003-muted)}
/* Две строки и многоточие: карточки в сетке обязаны быть одной высоты. */
[data-vibeui-block="card-003"] [data-part="about"]{
margin:0;font-size:0.8125rem;line-height:1.45;color:var(--vibeui-card-003-muted);
display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
[data-vibeui-block="card-003"] [data-part="stats"]{
display:flex;gap:0.75rem;padding:0.5rem 0;
border-top:1px solid var(--vibeui-card-003-border);
border-bottom:1px solid var(--vibeui-card-003-border);
}
[data-vibeui-block="card-003"] [data-part="stat"]{display:flex;flex-direction:column;gap:0.0625rem}
[data-vibeui-block="card-003"] [data-part="stat-value"]{font-size:0.9375rem;font-weight:680;font-variant-numeric:tabular-nums;line-height:1.1}
[data-vibeui-block="card-003"] [data-part="stat-label"]{font-size:0.6875rem;color:var(--vibeui-card-003-muted)}
[data-vibeui-block="card-003"] [data-part="actions"]{display:flex;gap:0.375rem}
[data-vibeui-block="card-003"] button{
appearance:none;cursor:pointer;flex:1;
height:2.125rem;padding:0 0.75rem;
border:1px solid var(--vibeui-card-003-border);border-radius:0.5rem;
background:transparent;color:inherit;font:inherit;font-size:0.8125rem;font-weight:600;
}
[data-vibeui-block="card-003"] button[data-primary="true"]{
border-color:transparent;background:var(--vibeui-card-003-accent);color:oklch(0.99 0.01 265);
}
[data-vibeui-block="card-003"] button:focus-visible{outline:2px solid var(--vibeui-card-003-accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="card-003"] *{animation:none!important;transition:none!important}}
`

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[0]?.toUpperCase() ?? "")
    .join("")
}

const DEFAULT_STATS = [
  { label: "Проектов", value: "14" },
  { label: "В команде", value: "3 года" },
  { label: "Отклик", value: "2 ч" },
]

/**
 * Карточка человека: аватар, роль, цифры в ряд и два действия.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Card003({
  name = "Мария Гурова",
  role = "Продуктовый дизайнер",
  about = "Веду каталог и дизайн-систему, собираю интерфейсы, которые не приходится объяснять словами.",
  stats = DEFAULT_STATS,
  actionLabel = "Написать",
  secondaryLabel = "Профиль",
  accent,
  className,
  style,
  ...props
}: Card003Props) {
  const palette = {
    "--vibeui-card-003-hue": hue(name),
    ...(accent ? { "--vibeui-card-003-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-card-003" precedence="medium">
        {STYLES}
      </style>
      <article
        {...props}
        data-vibeui-block="card-003"
        className={className}
        style={palette}
      >
        <div data-part="head">
          <span data-part="avatar" aria-hidden="true">
            {initials(name)}
          </span>
          <span>
            <h3 data-part="name">{name}</h3>
            <span data-part="role">{role}</span>
          </span>
        </div>
        {about ? <p data-part="about">{about}</p> : null}
        {stats.length ? (
          <div data-part="stats">
            {stats.map((stat) => (
              <span key={stat.label} data-part="stat">
                <span data-part="stat-value">{stat.value}</span>
                <span data-part="stat-label">{stat.label}</span>
              </span>
            ))}
          </div>
        ) : null}
        <div data-part="actions">
          <button type="button" data-primary="true">
            {actionLabel}
          </button>
          <button type="button">{secondaryLabel}</button>
        </div>
      </article>
    </>
  )
}