Media Card

Presents an item on its own artwork, for content the image identifies.

MIX-01
Your mix
Updates daily

Configurations

Supported configurations for this component.

Configurations

6 examples
Play action
MIX-01
Your mix
Updates daily
CTA action
CH-04
Deep focus
Ambient · 2h
No action
CH-09
Static art
Cover only
Playing
MIX-01
Your mix
Now playing
Stacked
Late nightCH-12
Continuous readings from the outer coil array, refreshed every few seconds.
Stacked, tag on image
CH-12
Late night
Continuous readings from the outer coil array, refreshed every few seconds.

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

PropTypeDefaultDescription
imagestring-Media image URL. Full-bleed background in `overlay` layout; a discrete block at the top of the card in `stacked` layout. Omitted, the card shows its plain surface where the photo would be.
lightImagestring-Optional light-theme version of `image`, for a picture made for both themes. Both are layered and the Andromeda theme shows one: `image` in dark, `lightImage` in light. Needs `image`. If `lightImage` fails to load, `image` shows in light too.
layout'overlay' | 'stacked' | 'stacked-pinned''overlay'`overlay` (default): image fills the card, text sits over a lower scrim. `stacked`: image is its own block at the top, text sits below it on the plain card surface — for a caption that needs full-contrast text rather than text-over-photo. `stacked-pinned`: the same, with `code` pinned to the image's top-left corner instead of the title line.
codestring'MIX-01'Short identifier; a small pinned tag on the image corner in `overlay`, alongside the title in `stacked`. A falsy value hides it.
titlestring'Your Mix'Primary title shown over the lower image edge in `overlay`, or below the image in `stacked`.
metastring'Updates daily'Line beneath the title: an uppercase sans metadata label in `overlay`, a sentence-case description in `stacked`.
action'play' | 'cta' | 'none''play'Selects the card's single action treatment.
ctaLabelstring'Open'CTA action wording: the visible label on `stacked`'s primary button, the accessible label on `overlay`'s arrow icon button.
playingbooleanfalseShows the active pause control when the play action is selected.
onAction() => voidNOOPCalled when the play or CTA control is pressed, or the card is clicked anywhere else.
heightnumber | string200CSS height of the card in `overlay` layout, or of the image block alone in `stacked` layout (the content block below adds its own height on top of it).
classNamestring''Additional class names applied to the Card root.
styleReact.CSSPropertiesEMPTY_STYLEInline styles merged onto the Card root.

More Andromeda Pro components