Display
Activity Feed
An activity feed: the initials circle is tinted with a hue derived from the name, and the time sits in its own column with tabular numerals.
- timeline
- feed
- activity
- avatar
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/timeline-002?lang=en
Activity
Аня Петрова оставила комментарий в Главная страница
2 минМарк Иванов закрыл задачу Экспорт в CSV
18 минАня Петрова загрузила 6 файлов
1 чЛиза Ким пригласила в проект Олег С.
3 ч
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 "timeline-002" (Activity Feed) 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/timeline-002.json
Registry item: https://vibeui.ru/r/timeline-002.json
Installs to: components/vibeui/timeline-002.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
An activity feed: the initials circle is tinted with a hue derived from the name, and the time sits in its own column with tabular numerals.
An activity feed: an avatar with initials tinted by a hue derived from the name, the action, and the time in its own column. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Timeline002 } from "@/components/vibeui/timeline-002"
<Timeline002
title="Activity"
entries={[
{ author: "Anna Petrova", action: "commented on", target: "Home page", time: "2 min" },
{ author: "Mark Ivanov", action: "closed the task", target: "CSV export", time: "18 min" },
]}
/>
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-timeline-002-* palette — do not swap it for your theme tokens
- the hue derived from the name: it gives a person a stable colour, a random one breaks recognition
- the line drawn by the row's pseudo-element — a separate column dangles below the last event
- the time in its own column with tabular numerals: otherwise the rows stop lining up
- the block's own light surface: dark text disappears on a dark page
- the colour accent on the edited object rather than on the verb: the eye looks for the object
## 6. You may change
- the feed heading through title
- the events through entries: author, action, target and time
- the accent colour through accent
- the feed width through the root element's max-width
## 7. Rules
- Initials come from the first two words of the name: single-word handles give one letter.
- There are only twelve hues, so in a long feed colours will inevitably repeat.
- Time is a string, not a date: formatting stays on the application side.
- 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/timeline-002.jsonhttps://vibeui.ru/r/timeline-002.jsonКомпонент самодостаточен: один файл, без зависимостей, палитра в локальных переменных --vibeui-timeline-002-*. Серверный: хуков нет. Оттенок аватара считается из имени функцией на FNV-хеше, поэтому один человек всегда получает один и тот же кружок и опознаётся в ленте как повторяющееся пятно цвета. Линия ленты нарисована псевдоэлементом строки, а не отдельным столбиком: она обрывается на последнем аватаре и не свисает под списком. Время вынесено в третью колонку grid с font-variant-numeric:tabular-nums — в ленте из двадцати строк цифры обязаны стоять по одной вертикали. Блок несёт собственную светлую подложку, потому что текст в нём тёмный.
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 Timeline002Entry = {
/** Имя автора: из него берутся инициалы и оттенок кружка. */
author: string
action: string
target?: string
time: string
}
export type Timeline002Props = Omit<
ComponentPropsWithoutRef<"section">,
"children"
> & {
entries?: Timeline002Entry[]
title?: string
accent?: string
}
// Идея компонента: лента активности, где отправитель узнаётся раньше текста.
// Кружок с инициалами стоит на линии и красится оттенком, посчитанным из
// имени, поэтому одного человека видно в ленте как повторяющееся пятно цвета.
// Время вынесено в отдельный столбец с табличными цифрами: в ленте из
// двадцати строк «2 мин» и «12 мин» обязаны стоять по одной вертикали.
const STYLES = `
:where([data-vibeui-block="timeline-002"]){
--vibeui-timeline-002-bg:oklch(1 0 0);
--vibeui-timeline-002-fg:oklch(0.22 0.014 265);
--vibeui-timeline-002-muted:oklch(0.56 0.014 265);
--vibeui-timeline-002-border:oklch(0.91 0.006 265);
--vibeui-timeline-002-line:oklch(0.93 0.005 265);
--vibeui-timeline-002-accent:oklch(0.55 0.17 265);
--vibeui-timeline-002-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Собственная светлая подложка: текст тёмный и обязан читаться на любой странице. */
[data-vibeui-block="timeline-002"]{
display:flex;flex-direction:column;gap:0.75rem;
width:100%;max-width:26rem;box-sizing:border-box;padding:0.875rem;
background:var(--vibeui-timeline-002-bg);
border:1px solid var(--vibeui-timeline-002-border);border-radius:0.875rem;
font-family:var(--vibeui-timeline-002-font);color:var(--vibeui-timeline-002-fg);
}
[data-vibeui-block="timeline-002"] [data-part="title"]{margin:0;font-size:0.9375rem;font-weight:650}
[data-vibeui-block="timeline-002"] [data-part="feed"]{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}
[data-vibeui-block="timeline-002"] [data-part="row"]{
position:relative;display:grid;grid-template-columns:1.75rem 1fr auto;
align-items:start;gap:0.625rem;padding-bottom:0.875rem;
}
/* Линия — псевдоэлемент строки, а не отдельный столбик: она обрывается
ровно на последнем аватаре и не свисает под лентой. */
[data-vibeui-block="timeline-002"] [data-part="row"]::before{
content:"";position:absolute;left:0.8125rem;top:2rem;bottom:0;
width:1px;background:var(--vibeui-timeline-002-line);
}
[data-vibeui-block="timeline-002"] [data-part="row"]:last-child{padding-bottom:0}
[data-vibeui-block="timeline-002"] [data-part="row"]:last-child::before{display:none}
[data-vibeui-block="timeline-002"] [data-part="avatar"]{
display:flex;align-items:center;justify-content:center;
width:1.75rem;height:1.75rem;border-radius:9999px;
background:oklch(0.92 0.05 var(--vibeui-timeline-002-hue,250));
color:oklch(0.35 0.09 var(--vibeui-timeline-002-hue,250));
font-size:0.6875rem;font-weight:700;letter-spacing:0.02em;
}
[data-vibeui-block="timeline-002"] [data-part="text"]{margin:0;font-size:0.8125rem;line-height:1.45;color:var(--vibeui-timeline-002-muted)}
[data-vibeui-block="timeline-002"] [data-part="author"]{color:var(--vibeui-timeline-002-fg);font-weight:600}
/* Цель правки помечена цветом акцента: в потоке одинаковых фраз глаз
цепляется за объект, а не за глагол. */
[data-vibeui-block="timeline-002"] [data-part="target"]{color:var(--vibeui-timeline-002-accent);font-weight:600}
[data-vibeui-block="timeline-002"] [data-part="time"]{
font-size:0.6875rem;color:var(--vibeui-timeline-002-muted);
font-variant-numeric:tabular-nums;white-space:nowrap;padding-top:0.125rem;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="timeline-002"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_ENTRIES: Timeline002Entry[] = [
{
author: "Аня Петрова",
action: "оставила комментарий в",
target: "Главная страница",
time: "2 мин",
},
{
author: "Марк Иванов",
action: "закрыл задачу",
target: "Экспорт в CSV",
time: "18 мин",
},
{ author: "Аня Петрова", action: "загрузила 6 файлов", time: "1 ч" },
{
author: "Лиза Ким",
action: "пригласила в проект",
target: "Олег С.",
time: "3 ч",
},
]
/** Оттенок из имени: один человек всегда получает один и тот же кружок. */
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 Timeline002({
entries = DEFAULT_ENTRIES,
title = "Активность",
accent,
className,
style,
...props
}: Timeline002Props) {
const palette = {
...(accent ? { "--vibeui-timeline-002-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-timeline-002" precedence="medium">
{STYLES}
</style>
<section
{...props}
data-vibeui-block="timeline-002"
className={className}
style={palette}
>
<h3 data-part="title">{title}</h3>
<ol data-part="feed">
{entries.map((entry, index) => (
<li data-part="row" key={`${entry.author}-${index}`}>
<span
data-part="avatar"
aria-hidden="true"
style={
{
"--vibeui-timeline-002-hue": hue(entry.author),
} as CSSProperties
}
>
{initials(entry.author)}
</span>
<p data-part="text">
<span data-part="author">{entry.author}</span> {entry.action}
{entry.target ? (
<>
{" "}
<span data-part="target">{entry.target}</span>
</>
) : null}
</p>
<span data-part="time">{entry.time}</span>
</li>
))}
</ol>
</section>
</>
)
}