121
GitHub
Data display

CoverImage

Presents responsive editorial artwork with optional hover lift and gradient treatment.

FrameworksAstro · React · Elements

Registry commandlumen add CoverImage

InteractionNative markup

Design sourceLibrary file

01

See it in context

Preview

Cover image
Cover image with hover lift
Cover image with bottom gradient
02

Copy a working example

Usage

astro
---
import { CoverImage } from '@santi020k/lumen-astro'

import dummyImage from '../assets/cover-dummy.jpg'
---

<div style="display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));">
  <CoverImage
    alt="Cover image"
    image={dummyImage}
    sizes="(min-width: 1024px) 400px, 100vw"
  />
  <CoverImage
    alt="Cover image with hover lift"
    hover
    image={dummyImage}
    sizes="(min-width: 1024px) 400px, 100vw"
  />
  <CoverImage
    alt="Cover image with bottom gradient"
    image={dummyImage}
    showBottomGradient
    sizes="(min-width: 1024px) 400px, 100vw"
  />
</div>
---
import { CoverImage } from '@santi020k/lumen-astro'

import dummyImage from '../assets/cover-dummy.jpg'
---

<div style="display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));">
  <CoverImage
    alt="Cover image"
    image={dummyImage}
    sizes="(min-width: 1024px) 400px, 100vw"
  />
  <CoverImage
    alt="Cover image with hover lift"
    hover
    image={dummyImage}
    sizes="(min-width: 1024px) 400px, 100vw"
  />
  <CoverImage
    alt="Cover image with bottom gradient"
    image={dummyImage}
    showBottomGradient
    sizes="(min-width: 1024px) 400px, 100vw"
  />
</div>
03

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add CoverImage
lumen add CoverImage

API reference

Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
imageImageMetadatarequiredSets the source image processed by astro:assets.
altstringrequiredSets the alt text, or pass ariaHidden for decorative covers.
mode"card" | "detail""card"Switches between the card crop and the contained detail frame.
hoverbooleanfalseLifts the cover on hover (respects reduced motion).
showBottomGradientbooleanfalseOverlays a bottom-to-top fade for legible captions.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.