ValyroUI English version

Tooltip

Всплывающие подсказки. Бесплатно, MIT · Базовые элементы › Метки и подсказки

Установка

npx valyro-cli@latest add tooltip
npx shadcn@latest add https://valyro.xyz/r/tooltip.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Tooltip } from 'valyro-ui';

Пропсы

PropTypeDefault
contentReactNodeTooltip text or content; nothing shows while it is empty. Or Tooltip.Content in the children.
children *ReactElement | ReactElement[]A single focusable element. It receives the hover/focus handlers and aria-describedby. In the compound form, a Tooltip.Trigger and a Tooltip.Content instead.
placementPlacement'top'Preferred side and alignment relative to the trigger; flips when there is no room.
delaynumber400Delay before showing, ms. Skipped while another tooltip was just visible.
disabledbooleanfalseNever show the tooltip; the trigger keeps working.
arrowbooleanfalseSmall pointer towards the trigger.
animation'fade' | 'spring''fade'fade (default) or spring: springs out of the trigger's side, and moving straight on to the next spring tooltip glides the tooltip across instead of fading one out and another in.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
classNamestringClass for the tooltip surface.

Составные части

Tooltip.Trigger (TooltipTrigger), Tooltip.Content (TooltipContent)

Похожие компоненты

  • Badge — Статусы и метки
  • Avatar — Аватары пользователей
  • Separator — Разделители
  • Button — Кнопки всех типов
  • Icon Button — Кнопка с иконкой
  • Button Group — Группы кнопок
  • Copy to Clipboard — Копирование с подтверждением
  • Skeleton — Заглушки загрузки
  • Spinner — Индикатор загрузки
  • Progress Bar — Полосы прогресса

Назад: Avatar · Далее: Separator · Весь раздел «Базовые элементы»