Build a landing page in an evening
Assembling a page out of ready-made blocks: what to hand the agent and what to write yourself.
Card
A content card: cover, eyebrow, title and footer. The whole surface is clickable while it still contains a single link.
put this in the header: https://vibeui.ru/c/card-001?lang=en
Assembling a page out of ready-made blocks: what to hand the agent and what to write yourself.
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
# Install and place "card-001" (Content 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-001.json
Registry item: https://vibeui.ru/r/card-001.json
Installs to: components/vibeui/card-001.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 content card: cover, eyebrow, title and footer. The whole surface is clickable while it still contains a single link.
A content card for a grid: a gradient cover, an eyebrow, a title link, a description and a footer. The entire surface is clickable through ::after on the one link, so twenty cards do not become sixty links. The layout is measured against the card's own width. Zero dependencies, one file, its own palette.
## 3. How to use it
import { Card001 } from "@/components/vibeui/card-001"
<Card001
eyebrow="Guide"
title="Build a landing page in an evening"
description="Assembling a page out of ready-made blocks."
href="/blog/landing"
footer="8 min read"
/>
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-001-* palette — do not swap it for your theme tokens (bg-card, border-border, text-muted-foreground and the like)
- the single-link technique: position:relative on the card and ::after on the title link — several links make the card tedious in a screen reader
- focus-within on the card: focus lands on the inner link, but the whole card has to show the ring
- the @container query instead of a media query: the card lives in a grid and must measure against its own width, not the window's
- the hover lift together with the transform reset under prefers-reduced-motion
- the heading structure: the card title is an h3, not a div with a big font
- the <style> block inside the component — it holds the palette, the cover and the layout
## 6. You may change
- the title, description and eyebrow copy and the footer content — the footer accepts your own element
- href — the destination; drop it and the card stops being a link
- the accent through the accent prop — it colours the eyebrow, the cover and the hover border
- the cover: replace the gradient in [data-part="media"] with an <img> at the same aspect-ratio
- max width and outer spacing through className
## 7. Rules
- Do not add a second link or a button on top of ::after — they end up under the invisible layer. If you need a button, lift it with position:relative and z-index.
- Do not swap the heading for a div: in a card grid the titles are the page structure.
- Do not stretch the card to full screen width: the max-width is deliberate, a long description line reads poorly.
- 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.npx shadcn@latest add https://vibeui.ru/r/card-001.jsonhttps://vibeui.ru/r/card-001.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-card-001-*. Приём с ::after у ссылки заголовка растягивает её область на всю карточку: клик работает по любому месту, а в дереве доступности остаётся одна ссылка. Обложка нарисована градиентами и не требует картинки. Внутренние отступы и кегль заголовка считаются от собственной ширины карточки через @container, поэтому карточка одинаково выглядит в узкой колонке и в широкой сетке.
The same file your agent installs. Here in case you would rather copy it by hand.
import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from "react"
export type Card001Props = Omit<
ComponentPropsWithoutRef<"article">,
"title"
> & {
title?: string
description?: string
/** Надпись над заголовком: раздел, дата, тип материала. */
eyebrow?: string
/** Ссылка. Если задана, кликается вся карточка, а не только заголовок. */
href?: string
/** Подвал: цена, автор, кнопка. Пустой подвал не рисуется. */
footer?: ReactNode
accent?: string
}
// Идея компонента: кликает вся карточка, но ссылка остаётся одна. Заголовок
// растягивает свою область до краёв через ::after, поэтому в списке ссылок
// не появляется по три штуки на карточку — и скринридер читает одну.
const STYLES = `
:where([data-vibeui-block="card-001"]){
--vibeui-card-001-fg:oklch(0.22 0.016 265);
--vibeui-card-001-muted:oklch(0.52 0.014 265);
--vibeui-card-001-bg:oklch(1 0 0);
--vibeui-card-001-border:oklch(0.9 0.006 265);
--vibeui-card-001-accent:oklch(0.55 0.2 262);
--vibeui-card-001-radius:0.875rem;
--vibeui-card-001-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
container-type:inline-size;
}
[data-vibeui-block="card-001"]{
position:relative;display:flex;flex-direction:column;
max-width:22rem;box-sizing:border-box;
border:1px solid var(--vibeui-card-001-border);
border-radius:var(--vibeui-card-001-radius);
background:var(--vibeui-card-001-bg);color:var(--vibeui-card-001-fg);
font-family:var(--vibeui-card-001-font);
transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
[data-vibeui-block="card-001"]:hover{
border-color:color-mix(in oklab,var(--vibeui-card-001-accent) 35%,var(--vibeui-card-001-border));
box-shadow:0 8px 24px -12px oklch(0.2 0.03 265 / 30%);
transform:translateY(-2px);
}
[data-vibeui-block="card-001"]:focus-within{
border-color:var(--vibeui-card-001-accent);
box-shadow:0 0 0 3px color-mix(in oklab,var(--vibeui-card-001-accent) 20%,transparent);
}
[data-vibeui-block="card-001"] [data-part="media"]{
aspect-ratio:16 / 9;border-radius:calc(var(--vibeui-card-001-radius) - 1px) calc(var(--vibeui-card-001-radius) - 1px) 0 0;
background:
radial-gradient(120% 90% at 15% 0%,color-mix(in oklab,var(--vibeui-card-001-accent) 35%,transparent),transparent 60%),
linear-gradient(160deg,oklch(0.94 0.02 265),oklch(0.88 0.03 250));
}
[data-vibeui-block="card-001"] [data-part="body"]{
display:flex;flex-direction:column;gap:0.375rem;padding:1rem 1.125rem 1.125rem;
}
[data-vibeui-block="card-001"] [data-part="eyebrow"]{
font-size:0.6875rem;font-weight:600;letter-spacing:0.08em;text-transform:uppercase;
color:var(--vibeui-card-001-accent);
}
[data-vibeui-block="card-001"] [data-part="title"]{
margin:0;font-size:1.0625rem;font-weight:600;line-height:1.3;letter-spacing:-0.01em;
}
[data-vibeui-block="card-001"] [data-part="title"] a{
color:inherit;text-decoration:none;outline:none;
}
/* Ссылка заголовка накрывает карточку целиком: одна ссылка, вся площадь. */
[data-vibeui-block="card-001"] [data-part="title"] a::after{
content:"";position:absolute;inset:0;border-radius:inherit;
}
[data-vibeui-block="card-001"] [data-part="description"]{
margin:0;font-size:0.875rem;line-height:1.5;color:var(--vibeui-card-001-muted);
}
[data-vibeui-block="card-001"] [data-part="footer"]{
display:flex;align-items:center;gap:0.5rem;
margin-top:0.375rem;padding-top:0.75rem;
border-top:1px solid var(--vibeui-card-001-border);
font-size:0.8125rem;color:var(--vibeui-card-001-muted);
}
@container (min-width: 26rem){
[data-vibeui-block="card-001"] [data-part="body"]{padding:1.25rem 1.375rem 1.375rem}
[data-vibeui-block="card-001"] [data-part="title"]{font-size:1.1875rem}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="card-001"] *{animation:none!important;transition:none!important}}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="card-001"]:hover{transform:none}}
`
/**
* Карточка материала: обложка, заголовок-ссылка на всю площадь, подвал.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Card001({
title = "Как собрать лендинг за вечер",
description = "Разбираем сборку страницы из готовых блоков: что отдать агенту, а что править руками.",
eyebrow = "Практика",
href = "#",
footer = "8 минут чтения",
accent,
className,
style,
...props
}: Card001Props) {
const palette = {
...(accent ? { "--vibeui-card-001-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-card-001" precedence="medium">
{STYLES}
</style>
<article
{...props}
data-vibeui-block="card-001"
className={className}
style={palette}
>
<div data-part="media" aria-hidden="true" />
<div data-part="body">
{eyebrow ? <span data-part="eyebrow">{eyebrow}</span> : null}
<h3 data-part="title">{href ? <a href={href}>{title}</a> : title}</h3>
{description ? <p data-part="description">{description}</p> : null}
{footer ? <div data-part="footer">{footer}</div> : null}
</div>
</article>
</>
)
}