Media Stage
Overview
MediaStage is the bare "media on a background, with content overlaid on top" primitive used by BannerBasic, BannerIntegrated, BannerShowcase, and any custom hero. It owns media positioning, the content slot, the background color, and a built-in ImageContrastOverlay, but leaves border-radius to the call site (apply the .radius-contained utility there).
When backgroundColor is a hex value, MediaStage runs it through colorToSurfaceTone and propagates the result to descendants so text and icons sitting on top stay legible. Non-hex values (CSS vars, light-dark(), rgb(), hsl(), or anything that doesn't parse as hex) short-circuit to the 'light' tone (same caveat as Backdrop). Pass an explicit surfaceTone to override the derived value.
Inheritable props and overlay
MediaStage exposes a set of inheritable props for components that want a brightness-aware surface as their root:
backgroundImagerenders a<Media>behind the content slot.backgroundImageSizesandbackgroundImageFit('cover'or'contain') tune how it's sized.- The
fallbackBackgroundImageDefault,fallbackBackgroundImageDark, andfallbackBackgroundImageBrighttrio kicks in whenbackgroundImageis absent: the resolved surface tone selects which fallback renders, so a single component can ship per-tone artwork. overlayaccepts anImageContrastOverlayprop bag and is forwarded to the built-in overlay element (rendered above the media, below the content).surfaceToneis the manual override; without it the tone derives frombackgroundColorviacolorToSurfaceTone(hex only).
Key Business & UX Benefits
- One primitive powers every hero and banner variant, so a brand refresh changes the look in one place instead of touching each banner type.
- Automatic surface-tone derivation keeps headline and CTA text legible when marketing recolors a banner background mid-campaign.
- Clean separation of media, content slot, and chrome lets product teams compose custom heroes without rewriting positioning logic.
Usage
<MediaStage :media="media" background-color="#EFEFEF">
<TextGroup caption="..." heading="..." subline="..." />
</MediaStage>
Feature List
- `backgroundColor` hex values run through `colorToSurfaceTone` and propagate the resolved tone to descendants for legible text and icons
- Non-hex backgrounds (CSS vars, `light-dark()`, `rgb()`, `hsl()`) short-circuit to `'light'`; pass `surfaceTone` to override
- `backgroundImage` with `backgroundImageSizes` and `backgroundImageFit` ('cover' or 'contain') renders a typed `<Media>` behind the content slot
- Three fallback slots (`fallbackBackgroundImageDefault`, `fallbackBackgroundImageDark`, `fallbackBackgroundImageBright`) let one component ship per-tone artwork
- Built-in `ImageContrastOverlay` accepts a forwarded prop bag via `overlay`, sitting between media and content
- Border radius left to the call site (`.radius-contained` utility), keeping the primitive composable inside cards, banners, and heros
API Reference
| Prop | Default | Type |
|---|---|---|
backgroundColor | string | |
fallbackBackgroundImageDefault | MediaImage { type, sources, placeholder, 2 more } | |
fallbackBackgroundImageDark | MediaImage { type, sources, placeholder, 2 more } | |
fallbackBackgroundImageBright | MediaImage { type, sources, placeholder, 2 more } | |
backgroundImage | ||
backgroundImageSizes | 100vw | string |
backgroundImageFit | "cover" | "contain" | |
surfaceTone | SurfaceTone ("dark" | "light" | "bright") | |
overlay | ImageContrastOverlayProps { variant, opacity } |
| Slot | Type |
|---|---|
default | {} |