MediaCard
Media card for event, article and listing grids: CoverImage cover, title, description, metadata, status chips and a whole-card link.
Design intent
Every media surface rebuilds the same card: cover art, a title, a date or location line, status chips and a details affordance. MediaCard composes CoverImage, Badge and the ArticleCard stretched-link pattern so imageless entities still look intentional and the card is one target, one hover state, one focus ring.
npx @slipstream-ui/cli@latest add media-cardFall Classic
Winter Showcase
Open Floor Social
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Card title. |
| description | React.ReactNode | — | Supporting copy under the title. |
| href | string | — | Destination URL; the whole card becomes a single link when set. |
| cover | CoverImageProps | — | Cover art rendered through CoverImage (src, alt, aspect, seed, mark, priority, sizes). |
| meta | React.ReactNode | — | Metadata line under the description, e.g. date, venue or deadline. |
| chips | MediaCardChip[] | — | Status or category chips rendered as Badges (label, variant, dot). |
| footer | React.ReactNode | — | Bottom slot for a details affordance; keep it non-interactive when the card is a link. |
| layout | 'vertical' | 'row' | 'vertical' | 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. |
| linkComponent | React.ElementType | — | Custom link element for routers (Next Link, react-router). |
| linkHrefProp | 'href' | 'to' | 'href' | Prop name used to pass the destination to linkComponent. |
| className | string | — | Classes merged onto the card surface. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't nest links or buttons in the footer
With href set the whole card is one link, so nested interactive elements are invalid HTML. Keep footer to text, or drop href and compose your own actions.
tsx// Avoid<MediaCard href="/events/1" footer={<Button>Register</Button>} />// Prefer<MediaCard href="/events/1" footer='Details →' />Don't use it for directory profiles
Entity profiles with avatars, stats and tags belong in EntityCard; MediaCard is for media-first surfaces (events, articles, listings).
tsx// Avoid<MediaCard cover={{ alt: firm.name }} title={firm.name} />// Prefer<EntityCard name={firm.name} entityType={firm.type} logo={firm.logo} />
Accessibility
- With href the entire card is one anchor with a visible focus ring; without href it is a static article.
- Keep footer free of nested interactive elements when href is set.
- CoverImage renders a real img with alt when src is present; the gradient fallback is aria-hidden.
Content guidelines
Title and meta
- Title is the card's heading; keep meta to one short line (date, venue, deadline)
- Footer is a details affordance such as 'Details →', not a second CTA
Good examples
- Mar 14 · Salt Lake City Convention Center
- Registration closes Feb 26
Bad examples
- Click here to view more information about this event
- Best event ever!!
Composition
Compose with CoverImage: The cover prop is forwarded to CoverImage, inheriting its seeded gradient fallback and aspect box
<MediaCard cover={{ src, alt, seed: slug, aspect: 'video' }} title={title} />
Compose with Badge: chips render as sm Badges; quiet outline tones (outline-success, outline-warning) fit status metadata
chips={[{ label: 'Open', variant: 'outline-success', dot: true }]}
Compose with ListToolbar: Pair with ListToolbar above the grid and Pagination below it for a complete filtered-list surface
<ListToolbar count={items.length} /><div className="grid gap-4"><MediaCard … /></div>
Related components: CoverImage, Badge, ArticleCard, EntityCard, ListToolbar
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.
