Feedback & Status

PreviewCard

A supplementary preview of a link on hover.

A supplementary preview of a link on hover.

Umami

Placement and delay#

React Zen

Component parts#

ComponentPurpose
PreviewCardRoot with open, defaultOpen, and onOpenChange
PreviewCardTriggerLink with href, delay, closeDelay, and render support
PreviewCardContentStyled popup with automatic portal and positioning

Component props#

PreviewCard#

NameTypeDescription
openbooleanControlled open state.
defaultOpenbooleanInitial open state when uncontrolled (default: false).
onOpenChange(open, eventDetails) => voidCalled when the preview opens or closes. Event details include the reason and a cancel method.
onOpenChangeComplete(open: boolean) => voidCalled after the opening or closing animation completes.
triggerIdstring | nullIdentifies the active trigger when controlling the preview.
defaultTriggerIdstring | nullIdentifies the trigger for an initially open, uncontrolled preview.
actionsRefRefObjectReceives imperative close and unmount actions.
handlePreviewCardHandleAssociates the preview with detached triggers.
childrenReactNode | functionPreview parts, or a render function receiving the active trigger payload.

The root does not render an HTML element. Set hover delays on PreviewCardTrigger and positioning options on PreviewCardContent.

PreviewCardTrigger#

NameTypeDescription
hrefstringLink destination.
delaynumberDelay in milliseconds before opening on hover (default: 600).
closeDelaynumberDelay in milliseconds before closing after the pointer leaves (default: 300).
idstringIdentifies this trigger for the root's triggerId or defaultTriggerId.
handlePreviewCardHandleAssociates a detached trigger with a preview.
payloadPayloadData passed to the root's children render function when this trigger is active.
childrenReactNodeLink content.
classNamestring | (state) => stringAdditional link classes, optionally based on the open state.
styleCSSProperties | (state) => CSSPropertiesAdditional link styles.
renderReactElement | functionCustomizes the trigger element.

Renders an anchor by default and supports standard anchor attributes and event handlers, including target and rel.

PreviewCardContent#

NameTypeDescription
childrenReactNodeContent displayed inside the preview.
classNamestring | (state) => stringAdditional popup classes, optionally based on popup state.
styleCSSProperties | (state) => CSSPropertiesPopup styles, including width or height.
positionerPropsBasePreviewCard.Positioner.PropsPositioning options such as side, align, sideOffset, alignOffset, and collisionAvoidance. Zen defaults to side: 'bottom', align: 'start', and sideOffset: 8.
portalPropsBasePreviewCard.Portal.PropsPortal options, including a custom container and keepMounted (default: false). The portal is appended to document.body by default.
renderReactElement | functionCustomizes the popup element.

BasePreviewCard refers to the PreviewCard namespace from @base-ui/react/preview-card. Positioning options belong inside positionerProps, and portal options belong inside portalProps.

The forwarded ref targets the popup div. Standard div attributes and event handlers are also supported. Styling callbacks receive the corresponding Base UI component state.

Preview content is supplementary: keep essential information accessible through the link destination. Use Popover for content that users must explicitly open and interact with.