Preview Link Card
betaAn inline link that previews its destination on hover or focus: the image wipes in from a shimmer while settling from a slight zoom, and the text lines rise in after it.
- Overlays
- 1 file
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add preview-link-cardnpm packages installed: class-variance-authority.
import { PreviewLinkCard } from "@/components/ui/preview-link-card";Default
In Prose
Image Only
Broken Image
<PreviewLinkCard>
| Prop | Type | Default |
|---|---|---|
href (required)The link's destination. Its hostname is shown on the card. | string | — |
image (required)The preview image's URL. Supply it yourself — nothing is fetched or screenshotted. | string | — |
align | "start" | "center" | "end" | "center" |
cardClassNameClasses for the card. | string | — |
closeDelayMilliseconds before it closes once the pointer leaves. | number | — |
defaultOpen | boolean | — |
descriptionA line or two about the page. | ReactNode | — |
headingA heading on the card, such as the page's title. | ReactNode | — |
imageAltAlt text for the image. Empty by default: the image previews the link, which already names it. | string | "" |
onOpenChange | (open: boolean) => void | — |
open | boolean | — |
openDelayMilliseconds of hover before the card opens. | number | — |
sideWhich side of the link the card opens on. | "top" | "right" | "bottom" | "left" | "top" |
size | "sm" | "md" | "lg" | "md" |
Plus every attribute of <a>.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes