HelixOverviewComponentsMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingCortexDocsEngramActiveTraceActiveRecallActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
Hover CardView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorA card that opens beside a link while the pointer rests on it or focus is on it, such as a preview of a person or a page.Also called Preview card, Link preview, Profile card, and Hover preview.ExperimentalSince 0.241.0OverlaysImportimport'@fusion.dev/helix/hover-card'import'@fusion.dev/helix-headless/hover-card'Preview
API referenceRoothelix-hover-cardA card that opens beside a link while the pointer rests on it or focus is on it, such as a preview of a person or a page.
PropTypeDescriptiondefaultOpenbooleanDefaultfalseWhether the element starts open. Ignored once open is written.delaynumberDefault600How long the pointer rests on the link before the card opens, in milliseconds.delayOutnumberDefault300How long the card stays once the pointer and focus have left the link and the card, in milliseconds.forstringDefault""The id of the link the card opens from, looked up in the card's own
root.offsetnumberDefault8The gap between the link and the card, in pixels.openbooleanWhether the element is open.placement"bottom"|"bottom-end"|"bottom-start"|"left"|"left-end"|"left-start"|"right"|"right-end"|"right-start"|"top"|"top-end"|"top-start"Default"bottom"The side to open the card on. It moves if that side does not fit.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The card's content, which may hold links and buttons.
EventTypeDescriptionhelix-before-closeHelixBeforeCloseEventThe card is about to close. Cancelable: cancel it to keep it open.helix-before-openHelixBeforeOpenEventThe card is about to open. Cancelable: cancel it to keep it closed.toggleToggleEventThe card opened or closed. The event carries newState and oldState.
MethodTypeDescriptionhide() => voidCloses the card, and cancels a waiting open.requestOpen(next: boolean) => booleanRequests that the element open or close, and returns whether the change
was applied.show() => voidOpens the card, and cancels a waiting close.toggleOpen() => booleanRequests the opposite of the current state.
PartDescriptionsurfaceThe card.surface-bottomAdded to surface while the card is below the link.surface-leftAdded to surface while the card is left of the link.surface-rightAdded to surface while the card is right of the link.surface-topAdded to surface while the card is above the link.
CSS PropertyDescription--hover-card-background-colorThe card's fill. Defaults to the floating overlay surface.--hover-card-inline-sizeThe card's width. Defaults to 20rem, and never wider than the window.--hover-card-paddingThe space inside the card. Defaults to --helix-space-md.--hover-card-shadowThe shadow that lifts the card over the page. Defaults to --helix-shadow-floating.
Custom stateDescriptionenteringFrom the moment the card opens until its entrance has finished.exitingFrom the moment the card closes until its exit has finished.openWhile the card is open.placed-bottomWhile the card sits below the link.placed-leftWhile the card sits to the left of the link.placed-rightWhile the card sits to the right of the link.placed-topWhile the card sits above the link.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Roothelix-headless-hover-cardA card that opens beside a link while the pointer rests on it or focus is on it, such as a preview of a person or a page.
PropTypeDescriptiondefaultOpenbooleanDefaultfalseWhether the element starts open. Ignored once open is written.delaynumberDefault600How long the pointer rests on the link before the card opens, in milliseconds.delayOutnumberDefault300How long the card stays once the pointer and focus have left the link and the card, in milliseconds.forstringDefault""The id of the link the card opens from, looked up in the card's own
root.offsetnumberDefault8The gap between the link and the card, in pixels.openbooleanWhether the element is open.placement"bottom"|"bottom-end"|"bottom-start"|"left"|"left-end"|"left-start"|"right"|"right-end"|"right-start"|"top"|"top-end"|"top-start"Default"bottom"The side to open the card on. It moves if that side does not fit.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The card's content, which may hold links and buttons.
EventTypeDescriptionhelix-before-closeHelixBeforeCloseEventThe card is about to close. Cancelable: cancel it to keep it open.helix-before-openHelixBeforeOpenEventThe card is about to open. Cancelable: cancel it to keep it closed.toggleToggleEventThe card opened or closed. The event carries newState and oldState.
MethodTypeDescriptionhide() => voidCloses the card, and cancels a waiting open.requestOpen(next: boolean) => booleanRequests that the element open or close, and returns whether the change
was applied.show() => voidOpens the card, and cancels a waiting close.toggleOpen() => booleanRequests the opposite of the current state.
PartDescriptionsurfaceThe card.surface-bottomAdded to surface while the card is below the link.surface-leftAdded to surface while the card is left of the link.surface-rightAdded to surface while the card is right of the link.surface-topAdded to surface while the card is above the link.
Custom stateDescriptionenteringFrom the moment the card opens until its entrance has finished.exitingFrom the moment the card closes until its exit has finished.openWhile the card is open.placed-bottomWhile the card sits below the link.placed-leftWhile the card sits to the left of the link.placed-rightWhile the card sits to the right of the link.placed-topWhile the card sits above the link.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Examples
NameDescriptionPreviewA preview of a person that opens from their name while the pointer rests on it or focus is on it.PreviewA preview of a person that opens from their name while the pointer rests on it or focus is on it.