Preview Card
A hover preview of a link's destination, shown beside it.
Built and maintained by the team at @appica_ui on GitHub.
Usage
A preview card shows a rich preview of a link when a sighted user hovers or focuses it — the avatar, name, and bio behind an @mention, or the cover image behind an article link. Unlike a Popover, the trigger is a real anchor: PreviewCardTrigger renders an <a>, so it still navigates on click.
PreviewCard is a compound component built on Base UI's Preview Card:
PreviewCard— the root. Holds the open state; opens on hover/focus of the trigger after a shortdelay.PreviewCardTrigger— the inline<a>that owns the link. Passhref(andtarget,rel, …); style it like any link in your prose.PreviewCardContent— the portalled, auto-positioned popup. Draws the card and the optionalarrow, and accepts the shared floating props (side,align,sideOffset, …).
Keep the preview supplementary
The popup only appears on hover/focus, so it's invisible on touch and to screen readers — it's a preview of where the link goes, not a place for unique or essential content. Anything important should also live on the linked page.
Reach for a PreviewCard to preview a link's destination inline in text. For interactive floating content from a button, use a Popover; for a plain hint, use a Tooltip; for a menu of actions, use a Dropdown Menu.
Examples
Profile preview
The classic use: an @mention in running text that reveals the person's or organization's profile card on hover — avatar, name, bio, follower count, and a follow action. The trigger stays a real link, so a click still navigates to the profile.
Built and maintained by the team at @appica_ui on GitHub.
Media preview
PreviewCardContent is just a styled container, so a card can lead with a cover image. Cancel the popup's inner padding with p-0, overflow-hidden to clip the image to the rounded corners, then pad the text block back in.
Our next offsite is at the Coastal House next month.
Side & alignment
Position the card with side (top / right / bottom / left) and align (start / center / end) on PreviewCardContent. It flips and shifts automatically to stay in view.
Without an arrow
Pass arrow={false} to drop the pointer for a flatter card that sits a little closer to the link.
Read more in the getting started guide.
RTL
Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware placement follows the same direction.
The card anchors from the trigger's leading edge and start/end alignment mirrors. For setup details and caveats, see the RTL guide.
Scoped RTL needs the direction on the positioner
The popup portals to <body>, so its start/end alignment mirrors from the document direction (read from CSS,
not from DirectionProvider) — automatic when <html dir="rtl">. If you instead scope RTL to a subtree of an LTR
page, set it on the positioner so alignment still mirrors: <PreviewCardContent positionerProps={{ dir: 'rtl' }}>.
See Floating popups in a scoped RTL region.
تم البناء والصيانة بواسطة فريق أبيكا على جيت هاب.
API reference
PreviewCard wraps Base UI's Preview Card. Each part forwards every remaining prop to the matching Base UI primitive, so anything it accepts works here — the tables below list the Appica additions and the most common props. See the Base UI docs for the complete API.
PreviewCard
The root. Holds the open state; renders no DOM of its own.
PreviewCardTrigger
The inline anchor that owns the link. Forwards Base UI's PreviewCard.Trigger (and every native <a> prop); use render to project it onto your router's link.
PreviewCardContent
The portalled, auto-positioned popup. Draws the card and the optional arrow, and accepts the shared floating props. Defaults to side="bottom", align="center", and sideOffset={10} (or 6 without an arrow).
Accessibility
- The trigger is a real
<a>, so it's keyboard-focusable and navigates on click; the preview opens on hover and focus. - The popup is supplementary — it's not announced as the link's name, and it doesn't appear on touch — so don't hide unique or essential content in it.
- Escape closes an open card; moving focus or the pointer away closes it after
closeDelay. - Enter/exit transitions are skipped when the user prefers reduced motion.