Tooltip
A popup that displays additonal information when hovering or focusing an element.
Basic Example
<script>
import { Tooltip, TooltipArrow, TooltipContent, TooltipTrigger } from 'lithesome';
</script>
<Tooltip>
<TooltipTrigger>Hover me</TooltipTrigger>
<TooltipContent>
<TooltipArrow />
Howdy!
</TooltipContent>
</Tooltip>
API Reference
<Tooltip />
| Property | Type | Description |
|---|---|---|
delay | number | [ number, number ] | The delay in `ms` in which it will take for the content show. Passing a number will set both in and out delays.\ Passing an array of two indexes will apply the `[in, out]` delays. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
visible | boolean | The current visibility of the contents. |
disabled | boolean | Disables the entire component tree. |
portalTarget | HTMLElement | string | The DOM target to mount the content to. |
floatingConfig | FloatingConfig | The underlying FloatingUI config. |
| State | Type | Description |
|---|---|---|
visible | boolean | True if the contents are visible. |
<TooltipTrigger />
| Property | Type | Description |
|---|---|---|
ref | E | The reference to the underlying element. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
custom | Snippet<[ S extends Record<string, any> ? { props: P; state: S; } : { props: P; } ]> | Snippet to be used when wanting a custom implementation. This will tell Lithesome not the render the default element and any state along with it. |
| State | Type | Description |
|---|---|---|
visible | boolean | True if the contents are visible. |
<TooltipContent />
| Property | Type | Description |
|---|---|---|
ref | E | The reference to the underlying element. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
custom | Snippet<[ S extends Record<string, any> ? { props: P; state: S; } : { props: P; } ]> | Snippet to be used when wanting a custom implementation. This will tell Lithesome not the render the default element and any state along with it. |
| State | Type | Description |
|---|---|---|
visible | boolean | True if the contents are visible. |
<TooltipArrow />
| Property | Type | Description |
|---|---|---|
ref | E | The reference to the underlying element. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
custom | Snippet<[ S extends Record<string, any> ? { props: P; state: S; } : { props: P; } ]> | Snippet to be used when wanting a custom implementation. This will tell Lithesome not the render the default element and any state along with it. |
| State | Type | Description |
|---|---|---|
visible | boolean | True if the contents are visible. |