Skip to main content
VelinStyle v1.3.0
⌂ Home
  1. Docs
  2. Components
  3. Overlays
  4. Tooltips

Tooltips 1.2.2

Lightweight text hints on hover/focus. Available as the <velin-tooltip> web component or the pure-CSS .velin-tooltip class. Deutsch: Tooltipps

Maturity: Documented as stable in VelinStyle 1.2.0. Design Intelligence (plan / review / agent meta) is separate and beta / foundation where noted.

When to use

When not

CSS tooltip

Wrap the trigger and a .velin-tooltip__content child. Optional .velin-tooltip--bottom places the tip below.

Hover me Hello from a tooltip! Bottom Shown below
<span class="velin-tooltip" tabindex="0">
  Hover me
  <span class="velin-tooltip__content">Hello from a tooltip!</span>
</span>

<span class="velin-tooltip velin-tooltip--bottom" tabindex="0">
  Bottom
  <span class="velin-tooltip__content">Shown below</span>
</span>

Web component

Use <velin-tooltip> with content and optional placement (top default, bottom, start, end). Slot the focusable trigger.

<velin-tooltip content="Tooltip text" placement="top">
  <button type="button" class="velin-btn velin-btn--secondary">Hover / focus</button>
</velin-tooltip>

Flip behaviour

Flip is automatic on show for top/bottom when the tip would leave the viewport. There is no flip attribute — do not add one.

Accessibility

API

Attributes (<velin-tooltip>)

AttributeTypeDescription
contentStringObserved — tip text (escaped). Use content, not text (that attribute is ignored).
placementStringObserved — top (default), bottom, start, end
visibleBooleanSet by the component while open (not a public show API)

Slots & parts

NameKindDescription
(default)SlotTrigger element
tipCSS partShadow tip surface

No public methods or events. CSS pattern: .velin-tooltip, .velin-tooltip__content, .velin-tooltip--bottom.

Best practices & pitfalls

Legacy *-wc tags

<velin-tooltip-wc> and <velin-stepper-wc> remain registered as deprecated aliases. Prefer <velin-tooltip> and <velin-stepper> in new markup.