Preview Card

A popup that appears when a link is hovered, showing a preview for sighted users.

The principles of good typography remain into the digital age.

API reference

Import the component and place its parts the following way:

Anatomy
import { PreviewCard } from '@base-ui-components/react/previewCard';

<PreviewCard.Root>
  <PreviewCard.Trigger />
  <PreviewCard.Backdrop />
  <PreviewCard.Positioner>
    <PreviewCard.Popup>
      <PreviewCard.Arrow />
    </PreviewCard.Popup>
  </PreviewCard.Positioner>
</PreviewCard.Root>

Root

PropTypeDefault
closeDelaynumber300
defaultOpenbooleanfalse
delaynumber600
onOpenChange(open, event, reason) => voidundefined
openbooleanfalse

Trigger

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Backdrop

PropTypeDefault
classNamestring | (state) => stringundefined
containerReact.Ref | HTMLElement | nullundefined
keepMountedbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Positioner

PropTypeDefault
align'start' | 'center' | 'end''center'
alignOffsetnumber0
anchor| React.Ref
| Element
| VirtualElement
| (() => Element
| VirtualElement
| null)
| null
undefined
arrowPaddingnumber5
classNamestring | (state) => stringundefined
collisionBoundary| 'clippingAncestors'
| Element
| Element[]
| Rect
'clipping-ancestors'
collisionPaddingnumber | Rect5
containerReact.Ref | HTMLElement | nullundefined
keepMountedbooleanfalse
positionMethod'absolute' | 'fixed''absolute'
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
side'top' | 'bottom' | 'left' | 'right''bottom'
sideOffsetnumber0
stickybooleanfalse
CSS VariableType
--anchor-heightnumber
--anchor-widthnumber
--available-heightnumber
--available-widthnumber
--transform-originstring
PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Arrow

PropTypeDefault
classNamestring | (state) => stringundefined
hideWhenUncenteredbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined