Feedback
Glossary Card
A glossary entry at an abbreviation in the text: the expansion, the section, the definition and related terms — a reference, not a short remark.
- hovercard
- glossary
- term
- definition
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/hovercard-005?lang=en
Статику мы раздаём через CDNContent Delivery NetworkinfrastructureСеть серверов, раздающих статические файлы из точки, ближайшей к посетителю. Сокращает задержку и снимает нагрузку с основного сервера.см. также: TTFB, кеш на краю, прогрев, поэтому первая загрузка идёт из ближайшего города.
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 "hovercard-005" (Glossary 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/hovercard-005.json
Registry item: https://vibeui.ru/r/hovercard-005.json
Installs to: components/vibeui/hovercard-005.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 glossary entry at an abbreviation in the text: the expansion, the section, the definition and related terms — a reference, not a short remark.
A glossary card: expansion, section, definition and related words. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Hovercard005 } from "@/components/vibeui/hovercard-005"
<Hovercard005
term="CDN"
full="Content Delivery Network"
category="infrastructure"
related={["TTFB", "warm-up"]}
/>
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-hovercard-005-* palette — do not swap it for your theme tokens
- the abbreviation as an inline element: a link or button mid-paragraph breaks the setting
- tabIndex=0 together with aria-describedby — otherwise the entry is unreachable by keyboard
- the expansion on the first line: without it an abbreviation stays an abbreviation
- opening on focus bound to the word wrapper rather than the paragraph
- the paragraph's own light surface: without it the dark text disappears on a dark background
## 6. You may change
- the abbreviation through term and its expansion through full
- the definition through definition and the section through category
- the related words through related
- the accent through the --vibeui-hovercard-005-accent variable
## 7. Rules
- Related terms are plain text, not links: a link inside the card is unreachable by pointer.
- A definition longer than four lines belongs in help, with the first sentence left in the card.
- An empty related array removes the bottom row together with its divider.
- 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/hovercard-005.jsonhttps://vibeui.ru/r/hovercard-005.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-hovercard-005-*. Серверный: раскрытие держится на :hover и :focus-visible самого сокращения внутри обёртки. Сокращение остаётся строчным элементом с tabIndex=0 — не ссылка и не кнопка, поэтому набор текста не рвётся. Карточка помечена ролью tooltip и связана через aria-describedby. Левая грань окрашена акцентом: это признак словарной статьи, а не уведомления.
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 Hovercard005Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
/** Сокращение, набранное в тексте. */
term?: string
/** Полная расшифровка сокращения. */
full?: string
definition?: string
category?: string
/** Смежные термины: подсказка ведёт к соседним статьям словаря. */
related?: string[]
}
// Идея компонента: словарная статья у сокращения в тексте. От подсказки она
// отличается структурой: расшифровка, раздел, определение и смежные термины —
// это карточка справочника, а не короткая реплика.
const STYLES = `
:where([data-vibeui-block="hovercard-005"]){
--vibeui-hovercard-005-bg:oklch(0.995 0.004 90);
--vibeui-hovercard-005-fg:oklch(0.24 0.014 265);
--vibeui-hovercard-005-muted:oklch(0.52 0.014 265);
--vibeui-hovercard-005-border:oklch(0.89 0.01 90);
--vibeui-hovercard-005-accent:oklch(0.48 0.13 45);
--vibeui-hovercard-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="hovercard-005"]{
width:100%;max-width:28rem;box-sizing:border-box;
padding:1rem 1.125rem;
border:1px solid var(--vibeui-hovercard-005-border);border-radius:0.875rem;
background:var(--vibeui-hovercard-005-bg);
font-family:var(--vibeui-hovercard-005-font);color:var(--vibeui-hovercard-005-fg);
}
[data-vibeui-block="hovercard-005"] [data-part="line"]{margin:0;font-size:0.875rem;line-height:1.7}
/* Статья цепляется к сокращению в строке, а не к абзацу целиком. */
[data-vibeui-block="hovercard-005"] [data-part="host"]{position:relative;display:inline-block}
/* Сокращение в тексте: пунктир снизу и курсор help, ссылки здесь нет. */
[data-vibeui-block="hovercard-005"] [data-part="term"]{
cursor:help;font-weight:650;color:var(--vibeui-hovercard-005-accent);
text-decoration:underline dotted currentColor;text-underline-offset:0.22em;
border-radius:0.1875rem;
}
[data-vibeui-block="hovercard-005"] [data-part="term"]:focus-visible{outline:2px solid var(--vibeui-hovercard-005-accent);outline-offset:2px}
[data-vibeui-block="hovercard-005"] [data-part="card"]{
position:absolute;left:0;top:calc(100% + 0.5rem);z-index:20;
display:flex;flex-direction:column;gap:0.375rem;
width:19rem;box-sizing:border-box;padding:0.875rem;
border:1px solid var(--vibeui-hovercard-005-border);
border-left:3px solid var(--vibeui-hovercard-005-accent);
border-radius:0.75rem;
background:var(--vibeui-hovercard-005-bg);
box-shadow:0 22px 46px -28px oklch(0.25 0.03 60 / 55%);
opacity:0;visibility:hidden;translate:0 -0.25rem;
transition:opacity .15s ease,translate .15s ease,visibility .15s;
}
[data-vibeui-block="hovercard-005"] [data-part="host"]:hover [data-part="card"],
[data-vibeui-block="hovercard-005"] [data-part="host"]:focus-within [data-part="card"]{opacity:1;visibility:visible;translate:0 0}
[data-vibeui-block="hovercard-005"] [data-part="head"]{display:flex;align-items:baseline;gap:0.5rem;flex-wrap:wrap}
[data-vibeui-block="hovercard-005"] [data-part="full"]{font-size:0.875rem;font-weight:680;line-height:1.3}
[data-vibeui-block="hovercard-005"] [data-part="category"]{
flex:none;padding:0.0625rem 0.4375rem;border-radius:0.375rem;
background:color-mix(in oklab,var(--vibeui-hovercard-005-accent) 12%,transparent);
color:var(--vibeui-hovercard-005-accent);
font-size:0.625rem;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;
}
[data-vibeui-block="hovercard-005"] [data-part="definition"]{display:block;margin:0;font-size:0.8125rem;line-height:1.5;color:var(--vibeui-hovercard-005-muted)}
[data-vibeui-block="hovercard-005"] [data-part="related"]{
display:flex;align-items:baseline;gap:0.375rem;flex-wrap:wrap;
padding-top:0.375rem;border-top:1px dashed var(--vibeui-hovercard-005-border);
font-size:0.75rem;color:var(--vibeui-hovercard-005-muted);
}
[data-vibeui-block="hovercard-005"] [data-part="related"] b{color:var(--vibeui-hovercard-005-fg);font-weight:640}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="hovercard-005"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_RELATED = ["TTFB", "кеш на краю", "прогрев"]
/**
* Карточка термина глоссария: расшифровка, раздел, определение и смежные слова.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Hovercard005({
term = "CDN",
full = "Content Delivery Network",
definition = "Сеть серверов, раздающих статические файлы из точки, ближайшей к посетителю. Сокращает задержку и снимает нагрузку с основного сервера.",
category = "инфраструктура",
related = DEFAULT_RELATED,
className,
style,
...props
}: Hovercard005Props) {
return (
<>
<style href="vibeui-hovercard-005" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="hovercard-005"
className={className}
style={style as CSSProperties}
>
<p data-part="line">
Статику мы раздаём через{" "}
<span data-part="host">
<span
data-part="term"
tabIndex={0}
aria-describedby="vibeui-hovercard-005-card"
>
{term}
</span>
<span
data-part="card"
id="vibeui-hovercard-005-card"
role="tooltip"
>
<span data-part="head">
<span data-part="full">{full}</span>
{category ? <span data-part="category">{category}</span> : null}
</span>
<span data-part="definition">{definition}</span>
{related.length > 0 ? (
<span data-part="related">
см. также: <b>{related.join(", ")}</b>
</span>
) : null}
</span>
</span>
, поэтому первая загрузка идёт из ближайшего города.
</p>
</div>
</>
)
}