CoverImage
Presents responsive editorial artwork with optional hover lift and gradient treatment.
See it and copy it
Framework example
Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.



View CoverImage code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.---
import { CoverImage, Grid } from '@santi020k/lumen-astro'
import dummyImage from '../assets/cover-dummy.jpg'
---
<Grid gap="md" minItemWidth="14rem">
<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"
/>
</Grid>import { CoverImage, Grid, Image } from '@santi020k/lumen-react'
export const Example = () => (
<Grid minItemWidth="14rem">
<CoverImage>
<Image alt="Mountain landscape illustration" src="/comparison-before.svg" width={960} height={600} />
</CoverImage>
<CoverImage hover showBottomGradient>
<Image alt="The landscape in warm light" src="/comparison-after.svg" width={960} height={600} />
</CoverImage>
</Grid>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-grid gap="md" min-item-width="14rem">
<lumen-cover-image
alt="Cover image"
image={dummyImage}
sizes="(min-width: 1024px) 400px, 100vw"></lumen-cover-image>
<lumen-cover-image
alt="Cover image with hover lift"
hover
image={dummyImage}
sizes="(min-width: 1024px) 400px, 100vw"></lumen-cover-image>
<lumen-cover-image
alt="Cover image with bottom gradient"
image={dummyImage}
show-bottom-gradient
sizes="(min-width: 1024px) 400px, 100vw"></lumen-cover-image>
</lumen-grid>Framework differences
React: Compose Image inside CoverImage. Pass image dimensions, alt text, and loading behavior to Image rather than to the container.
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.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add CoverImagelumen add CoverImagepnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add CoverImage --target reactlumen add CoverImage --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add CoverImage --target elementslumen add CoverImage --target elementsAPI reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| Attribute | Values | Default | Description |
|---|---|---|---|
| image | ImageMetadata | required | Sets the source image processed by astro:assets. |
| alt | string | required | Sets the alt text, or pass ariaHidden for decorative covers. |
| mode | "card" | "detail" | "card" | Switches between the card crop and the contained detail frame. |
| hover | boolean | false | Lifts the cover on hover (respects reduced motion). |
| showBottomGradient | boolean | false | Overlays a bottom-to-top fade for legible captions. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |