Avatar
Profile Card
A person card for a hover card, but without popping up on hover: on a touch screen such a card either never appears or covers what was tapped.
- avatar
- profile
- card
- hover-card
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/avatar-019?lang=en
Мария Лоза
@maria · Moscow
Собирает интерфейсы из блоков и правит тексты так, чтобы их читали до конца.
- 412
- Установок
- 18
- Блоков
- 4
- В команде
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-019" (Profile 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/avatar-019.json
Registry item: https://vibeui.ru/r/avatar-019.json
Installs to: components/vibeui/avatar-019.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 for a hover card, but without popping up on hover: on a touch screen such a card either never appears or covers what was tapped.
A person card: portrait, bio, three stats and one action. Popping up is deliberately left out — the caller picks the mechanism. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Avatar019 } from "@/components/vibeui/avatar-019"
<Avatar019
name="Maria Loza"
handle="@maria · Moscow"
bio="Assembles interfaces out of blocks."
stats={[{ label: "Installs", value: "412" }]}
/>
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-019-* palette — do not swap it for your theme tokens
- the absence of hover popping: such a card is unreachable on a touch screen
- the three-stat cap — a fourth one breaks the row on a narrow screen
- tabular numerals in the stats: the figures must line up in a column
- the single action at the bottom: a row of buttons turns the card into a menu
- the card's own light surface: without it the dark text disappears on a dark background
## 6. You may change
- the name, the handle through handle and the bio
- the stats array
- the button caption through action
- the card width through max-width
## 7. Rules
- Putting the card in a hover card is fine, but mirror the trigger on tap — phones have no hover.
- Extra stats are dropped silently: decide the order in the caller when there are more than three.
- The bio is sized for two or three lines: a long text stretches a floating layer off screen.
- 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-019.jsonhttps://vibeui.ru/r/avatar-019.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-avatar-019-*. Серверный: хуков нет. Это содержимое карточки, а не механизм всплытия: вызывающий код кладёт её в popover или hover-card по своему усмотрению — так карточка остаётся пригодной и на сенсорном экране, где наведения нет. Показатели набраны табличными цифрами и стоят в ряд по три; четвёртый ломает строку на узком экране, поэтому лишние отбрасываются в разметке через slice.
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 Avatar019Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
name?: string
handle?: string
bio?: string
stats?: { label: string; value: string }[]
action?: string
}
// Идея компонента: карточка человека под наведение. Она не всплывает сама:
// всплывающая карточка на сенсорном экране либо не появляется, либо
// перекрывает то, на что нажали. Здесь это обычная карточка, которую
// вызывающий код кладёт в hover-card или popover по своему усмотрению.
// Показатели набраны табличными цифрами и стоят в ряд по три — четвёртый
// ломает строку на узком экране, поэтому лишние отбрасываются в разметке.
const STYLES = `
:where([data-vibeui-block="avatar-019"]){
--vibeui-avatar-019-size:3.25rem;
--vibeui-avatar-019-bg:oklch(1 0 0);
--vibeui-avatar-019-fg:oklch(0.24 0.014 265);
--vibeui-avatar-019-muted:oklch(0.55 0.014 265);
--vibeui-avatar-019-border:oklch(0.91 0.006 265);
--vibeui-avatar-019-accent:oklch(0.55 0.2 262);
--vibeui-avatar-019-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="avatar-019"]{
box-sizing:border-box;width:100%;max-width:19rem;padding:0.875rem;
background:var(--vibeui-avatar-019-bg);
border:1px solid var(--vibeui-avatar-019-border);border-radius:0.875rem;
box-shadow:0 16px 36px -24px oklch(0.2 0.03 265 / 35%);
font-family:var(--vibeui-avatar-019-font);color:var(--vibeui-avatar-019-fg);
}
[data-vibeui-block="avatar-019"] *{box-sizing:border-box}
[data-vibeui-block="avatar-019"] [data-part="head"]{display:flex;align-items:center;gap:0.625rem;margin-bottom:0.625rem}
[data-vibeui-block="avatar-019"] [data-part="face"]{
display:grid;place-items:center;flex:none;
width:var(--vibeui-avatar-019-size);height:var(--vibeui-avatar-019-size);
border-radius:9999px;
background:oklch(0.9 0.06 var(--vibeui-avatar-019-hue,265));
color:oklch(0.36 0.12 var(--vibeui-avatar-019-hue,265));
font-size:calc(var(--vibeui-avatar-019-size) * 0.34);font-weight:700;
}
[data-vibeui-block="avatar-019"] [data-part="name"]{margin:0;font-size:0.9375rem;font-weight:700}
[data-vibeui-block="avatar-019"] [data-part="handle"]{margin:0.0625rem 0 0;font-size:0.75rem;color:var(--vibeui-avatar-019-muted)}
[data-vibeui-block="avatar-019"] [data-part="bio"]{
margin:0 0 0.75rem;font-size:0.8125rem;line-height:1.5;color:var(--vibeui-avatar-019-muted);
}
/* Три показателя в ряд: четвёртый ломает строку на узком экране. */
[data-vibeui-block="avatar-019"] dl{
display:grid;grid-template-columns:repeat(3,1fr);gap:0.5rem;margin:0 0 0.75rem;
padding:0.5rem 0;border-top:1px solid var(--vibeui-avatar-019-border);
border-bottom:1px solid var(--vibeui-avatar-019-border);
}
[data-vibeui-block="avatar-019"] dd{
margin:0;font-size:0.9375rem;font-weight:700;font-variant-numeric:tabular-nums;
}
[data-vibeui-block="avatar-019"] dt{font-size:0.625rem;color:var(--vibeui-avatar-019-muted)}
[data-vibeui-block="avatar-019"] [data-part="action"]{
width:100%;appearance:none;cursor:pointer;height:2.125rem;
border:0;border-radius:0.625rem;
background:var(--vibeui-avatar-019-accent);color:oklch(1 0 0);
font:inherit;font-size:0.8125rem;font-weight:650;
}
[data-vibeui-block="avatar-019"] [data-part="action"]:focus-visible{outline:2px solid var(--vibeui-avatar-019-accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="avatar-019"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_STATS = [
{ label: "Установок", value: "412" },
{ label: "Блоков", value: "18" },
{ label: "В команде", value: "4" },
]
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("")
}
/**
* Карточка человека: содержимое для hover-card, но без всплытия по наведению.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Avatar019({
name = "Мария Лоза",
handle = "@maria · Москва",
bio = "Собирает интерфейсы из блоков и правит тексты так, чтобы их читали до конца.",
stats = DEFAULT_STATS,
action = "Написать сообщение",
className,
style,
...props
}: Avatar019Props) {
const palette = {
"--vibeui-avatar-019-hue": hue(name),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-avatar-019" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="avatar-019"
className={className}
style={palette}
>
<div data-part="head">
<span data-part="face" aria-hidden="true">
{initials(name)}
</span>
<div>
<p data-part="name">{name}</p>
<p data-part="handle">{handle}</p>
</div>
</div>
<p data-part="bio">{bio}</p>
<dl>
{stats.slice(0, 3).map((stat) => (
<div key={stat.label}>
<dd>{stat.value}</dd>
<dt>{stat.label}</dt>
</div>
))}
</dl>
<button type="button" data-part="action">
{action}
</button>
</div>
</>
)
}