Tooltip

This component renders the tooltip content only. The hover/focus trigger is {@attach tooltip(text)} from q-design-ui/attachments/tooltip; the component owns the look, the attachment owns the behavior. Never use the native title attribute.

Strings

A string is the common case: one short hint. It is never parsed as HTML, so a name with markup in it is safe.

Snippets

A snippet carries inline markup where the hint needs emphasis.

A title and lines

tooltip({ title, lines }): the title in the label face, each line under it smaller and quieter, all text. The trigger's description reads them together, joined by ". ".

Length and width

Long content clamps to 3 lines by default, so no tooltip dominates the viewport; maxLines changes the clamp. maxWidth narrows the bubble for a tight spot.

Components

A component and its props, for content richer than text: metadata, a small chart, a status panel.

Examples

A short hint

A short tooltip explanation.

Markup in a string, drawn as written

A name like <b>x</b> & co is drawn as written.

A snippet with inline markup

Supports inline markup for emphasis or links.

A title over two lines

3 notes

Agnes · 10:42

The gripper slips on the second grasp

Long content, clamped at three lines

A much longer tooltip that demonstrates the line-clamp behavior. By default it clamps to 3 lines but you can pass maxLines to change it. The default clamp prevents any single tooltip from dominating the viewport.

Long content, clamped at one line

A much longer tooltip that demonstrates the line-clamp behavior, but with maxLines set to 1.

A narrower bubble

Constrained to 200px wide.

A component with props
q-design-ui
Version 0.1.0

Component-shaped tooltip content. Useful when text isn't enough — e.g. to show metadata, a small chart, or a richer status panel.