Hovercard
Display a summary/preview of a link.
Basic Example
<script>
import { Hovercard, HovercardArrow, HovercardContent, HovercardTrigger } from 'lithesome';
</script>
<Hovercard>
<HovercardTrigger>Hover me</HovercardTrigger>
<HovercardContent>
<HovercardArrow />
Content
</HovercardContent>
</Hovercard>
API Reference
<Hovercard />
| 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. |
<HovercardTrigger />
| 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. |
<HovercardContent />
| 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. |
<HovercardArrow />
| 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. |
