Skip to content

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 ​

PropertyAttributeTypeDefaultDescription
expandedexpandedbooleanfalseWhether the associated hover card is currently open. Set by the parent.
contentIdcontentIdstring''The id of the associated content element, for aria-describedby. Set by the parent.

Slots ​

NameDescription
(default)The element that activates the hover card (link, button, avatar…).

CSS Parts ​

NameDescription
baseThe component's base wrapper element.
contentThe content container.

CSS Custom Properties ​

PropertyDefault
--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 ​

PropertyAttributeTypeDefaultDescription
placementplacementPlacement'bottom'Which side of the trigger to display the card on.
alignalign'start' | 'center' | 'end''center'Alignment of the card along the cross axis relative to the trigger.
openopenbooleanfalseWhether the card is visible. Managed by the parent flint-hover-card.
hoisthoistbooleanfalseWhen true, uses position: fixed to escape overflow containers.

Slots ​

NameDescription
(default)Rich content displayed inside the card.

CSS Custom Properties ​

PropertyDefault
--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 ​

PropertyAttributeTypeDefaultDescription
openDelayopen-delaynumber700Delay in milliseconds before the hover card opens.
closeDelayclose-delaynumber300Delay in milliseconds before the hover card closes.
hoisthoistbooleanfalseWhen true, the hover card content uses position: fixed instead of position: absolute

Events ​

EventDetailDescription
flint-hover-card-open&#123; open: true &#125;Fired when the card becomes visible. detail: &#123; open: true &#125;
flint-hover-card-close&#123; open: false &#125;Fired when the card is dismissed. detail: &#123; open: false &#125;

Slots ​

NameDescription
(default)Accepts flint-hover-card-trigger and flint-hover-card-content.

Methods ​

MethodDescription
handleTriggerEnter(): voidCalled by flint-hover-card-trigger when the pointer/focus enters.
handleTriggerLeave(): voidCalled by flint-hover-card-trigger when the pointer/focus leaves.
handleContentEnter(): voidCalled by flint-hover-card-content when the pointer enters the card.
handleContentLeave(): voidCalled by flint-hover-card-content when the pointer leaves the card.