Velocity X Components

Cards & Expandables

Media Cover Card

Image or video cover card locked to a fixed aspect ratio with a skeleton placeholder, so the cover never shifts the title or meta row as it loads — the fix for cover-card CLS in blog grids, galleries and video libraries.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add media-cover-card

Built for react. Needs react already installed as a peer dependency. An Astro-only project needs @astrojs/react wired up first — this won't run on its own in plain Astro.

Full docs for Media Cover Card →

Needs a licence key — subscribe here, then velocityx loginonce.

react v1.0.1 react
Media Cover Card
Laptop with code on screen

Shipping the component library

6 min readEngineering

Props

NameTypeRequiredDefaultDescription
coverType'image' | 'video'No'image'
srcstringYesimage src, or video src
posterstringYesvideo poster (shown until playable)
altstringNo''image alt text (ignored for video)
ratio'16/9' | '4/3' | '1/1' | '3/4'No'16/9'
titlestringYes
hrefstringYeswraps the title in a link
metastring[]No[]rendered as a "·"-joined row
classNamestringNo''

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/media-cover-card/MediaCoverCard.jsx

Using the Media Cover Card component

Install it with velocityx add media-cover-card. The CLI writes the source straight into your project — no runtime dependency, no registry lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.

More from Cards & Expandables.