Media Text Hover
A bold split headline that opens a responsive image or video window on hover, focus, or touch. Choose a centered brand reveal or let the split follow the pointer.
Installation#
pnpm dlx shadcn@latest add @davinciui/media-text-hoverUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
textHeadline rendered on both sides of the media window. | string | "DAVINCIUI" |
splitIndexCharacter index where the media opens in fixed mode. | number | midpoint |
modeKeep the split centered or move it across the headline with the pointer. | "fixed" | "dynamic" | "fixed" |
mediaSrcImage or video URL revealed between the two text fragments. | string | — |
mediaTypeOptional media type override when it cannot be inferred from the URL. | "image" | "video" | inferred |
mediaAltAlternative text for image media. Leave empty when the media is decorative. | string | "" |
mediaWidth / mediaHeightExpanded media dimensions in pixels. | number | 300 / 100 |
mediaRadiusMedia corner radius in pixels. | number | 0 |
objectFitControls how the image or video fills its window. | CSSProperties["objectFit"] | "cover" |
fontFamilyDisplay family used by both headline fragments. | string | "Impact, Arial Narrow, sans-serif" |
fontSizeResponsive strings such as clamp() are supported. | number | string | 130 |
fontWeightHeadline font weight. | number | string | 400 |
letterSpacingHeadline tracking. | number | string | "-0.02em" |
textColorHeadline color inherited from the surrounding stage by default. | string | "currentColor" |
springStiffness / springDampingSpring response used to open and close the media window. | number | 260 / 30 |
Accessibility#
The root is a focusable group labelled '<text> media reveal', and focusing or hovering opens the media. All visible text fragments and the media are aria-hidden, so the group label is the only announced content; touch toggles on tap.
Motion#
The media window animates width, margin, opacity, and blur with a Framer Motion spring tuned by springStiffness and springDamping. useReducedMotion forces the window open and sets duration 0, so reduced-motion users see a static reveal.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

