A card that previews a link's content when the link is hovered or focused.
close: Closes the preview card imperatively when called.children | ReactNode | PayloadChildRenderFunction<Payload> | – | The content of the preview card. This can be a regular React node or a render function that receives the |
defaultOpen | boolean | false | Whether the preview card is initially open. To render a controlled preview card, use the |
defaultTriggerId | string|null | – | ID of the trigger that the preview card is associated with. This is useful in conjunction with the |
handle | PreviewCardHandle<Payload> | – | A handle to associate the preview card with a trigger. If specified, allows external triggers to control the card's open state. Can be created with the PreviewCard.createHandle() method. |
onOpenChange | ((open: boolean, eventDetails: PreviewCardRootChangeEventDetails) => void) | – | Event handler called when the preview card is opened or closed. |
onOpenChangeComplete | ((open: boolean) => void) | – | Event handler called after any animations complete when the preview card is opened or closed. |
open | boolean | – | Whether the preview card is currently open. |
triggerId | string|null | – | ID of the trigger that the preview card is associated with. This is useful in conjunction with the |
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
PreviewCardCreateHandle is called, not rendered. It creates a handle: pass it as handle to a trigger and to the root, and the trigger can sit anywhere in the tree, outside the root.