Preview Card

A hover/focus-triggered floating card for glanceable link, user, and message previews.

Preview#

Opens by default so the anatomy is inspectable without hovering, but stays fully interactive: move away and it closes on hover/focus intent like any other trigger.

import {
  PreviewCard,
  PreviewCardContent,
  PreviewCardDescription,
  PreviewCardHeader,
  PreviewCardTitle,
  PreviewCardTrigger,
} from "raft-ui";

<PreviewCard>
  <PreviewCardTrigger />
  <PreviewCardContent>
    <PreviewCardHeader>
      <PreviewCardTitle />
    </PreviewCardHeader>
    <PreviewCardDescription />
  </PreviewCardContent>
</PreviewCard>

Mention hover card#

Hover or focus the @Atlas link below. delay / closeDelay default to 80ms / 40ms so repeated message previews stay responsive.

Follow up with @Atlas about the token migration.

API#WIP

PropTypeDefaultDescription
...propsBase UI PreviewCard.Root.PropsOwns open state, hover/focus intent, and trigger-card association via triggerId/handle.
PropTypeDefaultDescription
containerHTMLElement | RefObject | nullCustom portal container for framed previews or contained overlays.
...propsBase UI PreviewCard.Portal.PropsPortals the preview card to the body or a custom container.
PropTypeDefaultDescription
...propsBase UI PreviewCard.Trigger.PropsTrigger affordance and positioning anchor. Renders an <a> by default; use render to compose the actual link element and keep styling on the semantic element.
PropTypeDefaultDescription
...propsBase UI Popup + Positioner propsPortaled floating card. Defaults to side=bottom, align=start, sideOffset=6, disableAnchorTracking=true, and forwards anchor/collision/sticky positioning props.
PropTypeDefaultDescription
...propsdiv propsStatic card shell for docs previews and non-portaled comparison panes.
PropTypeDefaultDescription
...propsBase UI PreviewCard.Arrow.PropsOptional pointer triangle. Brutal hides it to match the source card, which never rendered one.
PropTypeDefaultDescription
...propsdiv propsLeading row for an avatar or icon plus a title stack.
PropTypeDefaultDescription
...propsdiv propsOptional horizontal divider between the header and description.
PropTypeDefaultDescription
...propsp propsPrimary heading, typically the previewed entity's name.
PropTypeDefaultDescription
...propsp propsSupporting copy or status line for the previewed entity.