Lapikit

Tooltip component

Tooltip

Display elegant tooltips with Tooltip. Fine-tuned customization, accessibility and SEO-friendliness for your Svelte components The Tooltip component can be used to display a tooltip on hover, focus or via a controlled opening. It’s designed to provide a simple, accessible way of delivering contextual information to the user, without cluttering up the interface.

Tooltip can be used with simple text using the label prop, or with richer HTML content using the tooltip slot.

It is particularly useful for enhancing the user experience by explaining icons, specifying actions or providing secondary details.

Examples of card

Base

Demonstrates the simplest use of the tooltip with prop label. The component is automatically positioned around its child element and displayed on hover or focus.

Density

Controls the internal spacing of tooltip content via prop density. Useful for adapting rendering to a dense (compact), more airy (comfortable) or default interface.

Position

Prop location is used to position the tooltip around its activator element. Available values are top, bottom, left and right. Positioning is automatic by default, but can be forced if required.

Snippet

Instead of using the prop label, you can fully customize the tooltip content with the tooltip slot. This allows you to integrate rich HTML, such as lists, links or specific styles. This approach is ideal for more complex tooltips.

Variant

The only variant currently available is arrow, which adds a directional arrow to the tooltip to better indicate its relationship to the trigger element.

API Reference

propstypedescriptiondefaulttype_extend
open $bindablebooleanControls tooltip openingfalse
isenumMakes the component <a> or <button> or div.divbutton | a | div
labelstringText content displayed in the tooltipundefined
darkbooleanEnable dark theme for component.false
lightbooleanEnable light theme for the component.false
colorstringApplies a custom color to text or icons.undefined
backgroundstringApply a custom background color.undefined
densityenumControls vertical densitydefaultcompact | comfortable | default
roundedstringControls item rounding (none, sm, md, lg, etc.).md
variantenumActivates arrow displayundefinedarrow
delayDurationnumberDelay (in ms) before tooltip appears850
disabledbooleanDisables tooltip displayfalse
locationenumPosition of the tooltip relative to its target element850top | bottom | left | right
avoidCollisionsbooleanPosition of the tooltip relative to its target elementfalse
tooltipSnippetAllows customized content to be used in the tooltipfalse

Variables CSS

variabledefaultdescription
–-tooltip-color–-kit-on-surfaceText color
–-tooltip-background–-kit-surfaceBackground color
–-tooltip-radius--kit-radius-mdTooltip edge radius

Tooltips complement your Buttons or Icons by providing discreet but useful context for users.

©2025 Lapikit.

Made with by Nycolaide