Hover Card β
Loading...
<flint-hover-card-trigger> β
Trigger element for a hover card. Place inside flint-hover-card. Automatically wires up to the nearest flint-hover-card ancestor.
- Tag:
<flint-hover-card-trigger> - Class:
FlintHoverCardTrigger
Import β
ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintHoverCardTrigger } from '@getufy/flint-ui';Usage β
html
<flint-hover-card-trigger></flint-hover-card-trigger>Properties β
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
expanded | expanded | boolean | false | Whether the associated hover card is currently open. Set by the parent. |
contentId | contentId | string | '' | The id of the associated content element, for aria-describedby. Set by the parent. |
Slots β
| Name | Description |
|---|---|
(default) | The element that activates the hover card (link, button, avatarβ¦). |
CSS Parts β
| Name | Description |
|---|---|
base | The component's base wrapper element. |
content | The content container. |
CSS Custom Properties β
| Property | Default |
|---|---|
--flint-font-family | β |
<flint-hover-card-content> β
The floating card panel. Position is controlled via placement and align. Place inside flint-hover-card; its open state is managed by the parent.
- Tag:
<flint-hover-card-content> - Class:
FlintHoverCardContent
Import β
ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintHoverCardContent } from '@getufy/flint-ui';Usage β
html
<flint-hover-card-content></flint-hover-card-content>Properties β
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
placement | placement | Placement | 'bottom' | Which side of the trigger to display the card on. |
align | align | 'start' | 'center' | 'end' | 'center' | Alignment of the card along the cross axis relative to the trigger. |
open | open | boolean | false | Whether the card is visible. Managed by the parent flint-hover-card. |
hoist | hoist | boolean | false | When true, uses position: fixed to escape overflow containers. |
Slots β
| Name | Description |
|---|---|
(default) | Rich content displayed inside the card. |
CSS Custom Properties β
| Property | Default |
|---|---|
--flint-hovercard-bg | β |
--flint-hovercard-border-color | β |
--flint-hovercard-radius | β |
--flint-hovercard-shadow | β |
--flint-hovercard-padding | β |
--flint-hovercard-min-width | β |
--flint-hovercard-font-size | β |
--flint-hovercard-color | β |
--flint-hovercard-offset | β |
--flint-hovercard-duration | β |
--flint-hovercard-z-index | β |
<flint-hover-card> β
Root container for a hover card. Manages open/closed state with configurable open and close delays.
- Tag:
<flint-hover-card> - Class:
FlintHoverCard
Import β
ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintHoverCard } from '@getufy/flint-ui';Usage β
html
<flint-hover-card></flint-hover-card>Properties β
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
openDelay | open-delay | number | 700 | Delay in milliseconds before the hover card opens. |
closeDelay | close-delay | number | 300 | Delay in milliseconds before the hover card closes. |
hoist | hoist | boolean | false | When true, the hover card content uses position: fixed instead of position: absolute |
Events β
| Event | Detail | Description |
|---|---|---|
flint-hover-card-open | { open: true } | Fired when the card becomes visible. detail: { open: true } |
flint-hover-card-close | { open: false } | Fired when the card is dismissed. detail: { open: false } |
Slots β
| Name | Description |
|---|---|
(default) | Accepts flint-hover-card-trigger and flint-hover-card-content. |
Methods β
| Method | Description |
|---|---|
handleTriggerEnter(): void | Called by flint-hover-card-trigger when the pointer/focus enters. |
handleTriggerLeave(): void | Called by flint-hover-card-trigger when the pointer/focus leaves. |
handleContentEnter(): void | Called by flint-hover-card-content when the pointer enters the card. |
handleContentLeave(): void | Called by flint-hover-card-content when the pointer leaves the card. |