Feedback

Term Underline

A term explained inside the text: the word carries a dotted underline and stays in the line, while the tooltip floats above without shifting anything.

  • tooltip
  • glossary
  • inline
  • typography

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/tooltip-008?lang=en

Мы платим за трафик по модели 95th percentileThe top five percent of the month's samples are dropped and the bill uses the next value., поэтому ночной бэкап не влияет на счёт.

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 "tooltip-008" (Term Underline) 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/tooltip-008.json

Registry item: https://vibeui.ru/r/tooltip-008.json
Installs to: components/vibeui/tooltip-008.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 term explained inside the text: the word carries a dotted underline and stays in the line, while the tooltip floats above without shifting anything.

A dotted-underlined term in running text with a pop-up explanation. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Tooltip008 } from "@/components/vibeui/tooltip-008"

<Tooltip008
  before="We are billed on the "
  term="95th percentile"
  definition="The top five percent of samples are dropped."
  after=", so the nightly backup does not affect the bill."
/>

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-tooltip-008-* palette — do not swap it for your theme tokens
- the term as an inline element: a button or link mid-paragraph breaks the setting
- tabIndex=0 together with aria-describedby — otherwise the explanation is unreachable by keyboard
- the dotted rule via text-decoration rather than a border: a border does not follow a wrapped word
- the sans-serif tooltip inside a serif paragraph — that is what makes it read as an aside
- the paragraph's own light surface: without it the dark text disappears on a dark background

## 6. You may change
- the surrounding copy through before and after
- the word itself through term and the explanation through definition
- the paragraph typeface through the --vibeui-tooltip-008-font variable
- the term colour through the --vibeui-tooltip-008-mark variable

## 7. Rules
- If the term wraps to the next line, the tooltip anchors to the first fragment of the word.
- The help cursor is the only hint for a mouse: do not remove it along with the dotted rule.
- On a phone the tooltip opens on tap through focus, but closing it needs a tap elsewhere.
- 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/tooltip-008.json
https://vibeui.ru/r/tooltip-008.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-tooltip-008-*. Серверный: открытие держится на :hover и :focus-visible самого слова. Термин остаётся строчным элементом с tabIndex=0 — не кнопка и не ссылка, поэтому набор текста не рвётся, но фокус с клавиатуры на нём есть. Подсказка набрана гротеском внутри серифного абзаца: так она читается как выноска, а не как часть текста. Подчёркивание пунктиром сделано свойством text-decoration, а не рамкой.

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 Tooltip008Props = Omit<
  ComponentPropsWithoutRef<"p">,
  "children"
> & {
  before?: string
  /** Термин: он остаётся частью строки, а не превращается в кнопку. */
  term?: string
  definition?: string
  after?: string
}

// Идея компонента: объяснение термина прямо в тексте. Слово подчёркнуто
// пунктиром — сигнал «здесь есть расшифровка», — но остаётся в строке и не
// ломает набор: подсказка выезжает поверх, ничего не сдвигая.
const STYLES = `
:where([data-vibeui-block="tooltip-008"]){
--vibeui-tooltip-008-bg:oklch(0.99 0.003 90);
--vibeui-tooltip-008-fg:oklch(0.28 0.012 265);
--vibeui-tooltip-008-border:oklch(0.9 0.008 90);
--vibeui-tooltip-008-mark:oklch(0.52 0.13 55);
--vibeui-tooltip-008-tip:oklch(0.25 0.014 265);
--vibeui-tooltip-008-font:ui-serif,Georgia,"Times New Roman",serif;
}
[data-vibeui-block="tooltip-008"]{
width:100%;max-width:30rem;box-sizing:border-box;
margin:0;padding:1.25rem 1.375rem;
border:1px solid var(--vibeui-tooltip-008-border);border-radius:0.875rem;
background:var(--vibeui-tooltip-008-bg);color:var(--vibeui-tooltip-008-fg);
font-family:var(--vibeui-tooltip-008-font);font-size:1rem;line-height:1.65;
text-wrap:pretty;
}
/* Термин остаётся словом в строке: не кнопка, не ссылка, набор не рвётся. */
[data-vibeui-block="tooltip-008"] [data-part="term"]{
position:relative;
color:var(--vibeui-tooltip-008-mark);font-weight:600;cursor:help;
text-decoration:underline dotted currentColor;
text-underline-offset:0.22em;text-decoration-thickness:from-font;
border-radius:0.1875rem;
}
[data-vibeui-block="tooltip-008"] [data-part="term"]:focus-visible{outline:2px solid var(--vibeui-tooltip-008-mark);outline-offset:2px}
[data-vibeui-block="tooltip-008"] [data-part="tip"]{
position:absolute;bottom:calc(100% + 0.45em);left:50%;z-index:20;
width:16rem;max-width:70vw;box-sizing:border-box;
padding:0.5rem 0.6875rem;border-radius:0.5rem;
background:var(--vibeui-tooltip-008-tip);color:oklch(0.97 0.002 265);
font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
font-size:0.75rem;font-weight:400;line-height:1.5;text-align:left;
box-shadow:0 18px 36px -26px oklch(0.15 0.02 265 / 70%);
pointer-events:none;opacity:0;
transform:translate(-50%,0.25rem);
transition:opacity .14s ease,transform .14s ease;
}
[data-vibeui-block="tooltip-008"] [data-part="tip"]::after{
content:"";position:absolute;left:50%;bottom:-0.1875rem;
width:0.5rem;height:0.5rem;margin-left:-0.25rem;
background:inherit;transform:rotate(45deg);
}
[data-vibeui-block="tooltip-008"] [data-part="term"]:hover [data-part="tip"],
[data-vibeui-block="tooltip-008"] [data-part="term"]:focus-visible [data-part="tip"]{
opacity:1;transform:translate(-50%,0);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="tooltip-008"] *{animation:none!important;transition:none!important}}
`

/**
 * Термин в тексте на пунктирном подчёркивании с всплывающим объяснением.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Tooltip008({
  before = "Мы платим за трафик по модели ",
  term = "95-й перцентиль",
  definition = "Из всех замеров за месяц отбрасываются пять процентов самых высоких, и счёт выставляется по следующему значению. Короткие всплески не попадают в оплату.",
  after = ", поэтому ночной бэкап не влияет на счёт.",
  className,
  style,
  ...props
}: Tooltip008Props) {
  return (
    <>
      <style href="vibeui-tooltip-008" precedence="medium">
        {STYLES}
      </style>
      <p
        {...props}
        data-vibeui-block="tooltip-008"
        className={className}
        style={style as CSSProperties}
      >
        {before}
        <span
          data-part="term"
          tabIndex={0}
          aria-describedby="vibeui-tooltip-008-tip"
        >
          {term}
          <span data-part="tip" role="tooltip" id="vibeui-tooltip-008-tip">
            {definition}
          </span>
        </span>
        {after}
      </p>
    </>
  )
}