Contact Us

Cover

DOC-00119 reference implementor, developer

A background image with configurable overlay and positioned content. Uses <img> with object-fit: cover for better responsive/loading behavior and accessible alt text. The video prop is reserved but not yet implemented.

File: src/core/components/ui/Cover.astro

Props

PropTypeDefaultNotes
image{ src: string; alt: string }requiredBackground image source and alt text
video{ src: string; type?: string }Reserved — emits console warning if passed
minHeightstring"24rem"Minimum height of the cover area
overlayOpacitynumber0.5Overlay opacity (0–1)
overlayColorstring"var(--st-color-surface-contrast)"Overlay color (semantic token reference)
contentPosition"center" | "start" | "end""center"Vertical position of content within the overlay
classstringAdditional CSS classes

Usage

---
import Cover from "@core/components/ui/Cover.astro";
---

{/* Basic cover with centered content */}
<Cover image={{ src: "/images/hero.jpg", alt: "Hero background" }}>
  <h2>Welcome</h2>
  <p>Overlay content with readable text.</p>
</Cover>

{/* Custom overlay and position */}
<Cover
  image={{ src: "/images/feature.jpg", alt: "Feature background" }}
  overlayOpacity={0.7}
  contentPosition="end"
  minHeight="32rem"
>
  <h2>Feature Highlight</h2>
</Cover>

Accessibility

  • Background image uses an <img> element with alt text (not CSS background-image), making it accessible to screen readers.
  • Overlay opacity and color should be chosen to ensure sufficient contrast for overlaid text. The default (0.5 opacity, dark overlay) provides reasonable contrast for most images, but authors must verify on a per-image basis.
  • The --st-color-surface-contrast token adapts between light and dark themes.
REQ-00044 implemented The theme shall include a limited set of composite components.
REQ-00272 implemented The theme shall provide layout and content components covering standard content block patterns (separator, button group, columns, media-text, pullquote, reading time, table, gallery, masonry gallery, cover, timeline).

Search

Search across pages and articles. Use arrow keys to navigate results.

Search across pages and articles.

Loading search...

Search is unavailable. Please try again later.

    No results for ""

    Try different keywords or fewer words.