# Media Stage

> Bare media + content stage primitive that derives surface tone from the configured background color.

## Playground

An interactive playground for MediaStage is embedded above. Open the canonical story on Storybook: [https://storybook.laioutr.cloud/?path=/story/ui-kit-molecules-mediastage--default](https://storybook.laioutr.cloud/?path=/story/ui-kit-molecules-mediastage--default)

## 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:

- `backgroundImage` renders a `<Media>` behind the content slot. `backgroundImageSizes` and `backgroundImageFit` (`'cover'` or `'contain'`) tune how it's sized. The asset can be a video as well as an image — see [Background video](#background-video) below.
- The `fallbackBackgroundImageDefault`, `fallbackBackgroundImageDark`, and `fallbackBackgroundImageBright` trio kicks in when `backgroundImage` is absent: the resolved surface tone selects which fallback renders, so a single component can ship per-tone artwork.
- `overlay` accepts an `ImageContrastOverlay` prop bag and is forwarded to the built-in overlay element (rendered above the media, below the content).
- `surfaceTone` is the manual override; without it the tone derives from `backgroundColor` via `colorToSurfaceTone` (hex only).

## Background video

When `backgroundImage` resolves to a video, `MediaStage` renders it through the `<Media>` component's [`playback="background"`](/laioutr-ui/ui-kit/general/media#background-video) mode: a muted autoplay loop with the native controls off, plus autoplay suppressed for visitors who set `prefers-reduced-motion: reduce`. A picked video plays silently and loops behind the foreground content.

`MediaStage` ships no pause control of its own. Auto-playing motion that runs longer than five seconds needs a pause mechanism ([WCAG 2.2.2](https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html)), so if your hero uses a video background that needs one, build the surface with `<Media playback="background">` directly instead of `MediaStage`'s background prop: bind `v-model:paused` and place your own control where the layout dictates. See [Pausing a background video](/laioutr-ui/ui-kit/general/media#pausing-a-background-video).

## 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.

## Feature List

<features :items="["`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"]">



</features>

## API Reference

#### Props

```json
{"type":"object","properties":{"backgroundColor":{"type":"string","default":"void 0"},"fallbackBackgroundImageDefault":{"type":"object","properties":{"type":{},"sources":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","description":"Image provider to be used with NuxtImage.\n\nIf you know the provider, e.g. `cloudinary`, `directus`, `sanity`, etc., you can use it here for optimal image-serving.\nOtherwise, the `raw` provider is a good fallback for plain URLs.\n\nAlternatively you can create a custom provider and use that here."},"src":{"type":"string"},"origin":{"type":"object","properties":{"libraryId":{"type":"string","description":"Producing library's id (the `.mediaLibrary()` registration id, default `meta.app`)."},"externalId":{"type":"string","description":"The asset's stable id within that library (Shopify gid, Shopware media UUID), when the backend has one."}},"additionalProperties":false,"required":["libraryId"],"description":"Origin of this source (producing library + stable external id)."},"width":{"type":"number"},"height":{"type":["number","undefined"]},"responsive":{"enum":["static","mobile","desktop"],"type":"string","description":"The responsiveness-mode of this source.\n- `static`: Source can be used for all viewport-sizes.\n- `mobile`: Source is a mobile-optimized version of the image.\n- `desktop`: Source is a desktop-optimized version of the image.\n\nIf not given, `static` can be assumed."},"focalPoint":{"description":"Optional focal point of the image, as fraction of the width and height of the image.\nIn form [x, y], e.g. [0.5, 0.5] for center.\n\nIf not given, center can be assumed."}},"additionalProperties":false,"required":["provider","src"]},"description":"Each source is a different version of the same image. Differences may be:\n- mobile or desktop version\n- different file-formats"},"placeholder":{"description":"Optional placeholder for the image.\n\nIf not given, the image will be loaded as is. Otherwise, the placeholder will be displayed while the image is loading."},"alt":{"type":["string","undefined"]},"meta":{},"aiDisclosure":{"enum":["generated","modified"],"type":"string","description":"AI disclosure for this asset, when the producing backend told us one.\nAbsent means no disclosure is known — there is nothing to disclose. It is\nnot an assertion that the asset is human-made.\n\nSet it only from an authoritative backend signal; never infer it from a\nfilename or guess. Omission is the correct answer for an unknown asset.\n\nDescribes the depicted content, so it is identical across every responsive\nvariant and format — which is why it lives here and not on the sources. A\nvideo's `poster` and an audio's `cover` are themselves images and carry\ntheir own, independent disclosure."}},"additionalProperties":false,"required":["type","sources"],"default":"void 0"},"fallbackBackgroundImageDark":{"type":"object","properties":{"type":{},"sources":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","description":"Image provider to be used with NuxtImage.\n\nIf you know the provider, e.g. `cloudinary`, `directus`, `sanity`, etc., you can use it here for optimal image-serving.\nOtherwise, the `raw` provider is a good fallback for plain URLs.\n\nAlternatively you can create a custom provider and use that here."},"src":{"type":"string"},"origin":{"type":"object","properties":{"libraryId":{"type":"string","description":"Producing library's id (the `.mediaLibrary()` registration id, default `meta.app`)."},"externalId":{"type":"string","description":"The asset's stable id within that library (Shopify gid, Shopware media UUID), when the backend has one."}},"additionalProperties":false,"required":["libraryId"],"description":"Origin of this source (producing library + stable external id)."},"width":{"type":"number"},"height":{"type":["number","undefined"]},"responsive":{"enum":["static","mobile","desktop"],"type":"string","description":"The responsiveness-mode of this source.\n- `static`: Source can be used for all viewport-sizes.\n- `mobile`: Source is a mobile-optimized version of the image.\n- `desktop`: Source is a desktop-optimized version of the image.\n\nIf not given, `static` can be assumed."},"focalPoint":{"description":"Optional focal point of the image, as fraction of the width and height of the image.\nIn form [x, y], e.g. [0.5, 0.5] for center.\n\nIf not given, center can be assumed."}},"additionalProperties":false,"required":["provider","src"]},"description":"Each source is a different version of the same image. Differences may be:\n- mobile or desktop version\n- different file-formats"},"placeholder":{"description":"Optional placeholder for the image.\n\nIf not given, the image will be loaded as is. Otherwise, the placeholder will be displayed while the image is loading."},"alt":{"type":["string","undefined"]},"meta":{},"aiDisclosure":{"enum":["generated","modified"],"type":"string","description":"AI disclosure for this asset, when the producing backend told us one.\nAbsent means no disclosure is known — there is nothing to disclose. It is\nnot an assertion that the asset is human-made.\n\nSet it only from an authoritative backend signal; never infer it from a\nfilename or guess. Omission is the correct answer for an unknown asset.\n\nDescribes the depicted content, so it is identical across every responsive\nvariant and format — which is why it lives here and not on the sources. A\nvideo's `poster` and an audio's `cover` are themselves images and carry\ntheir own, independent disclosure."}},"additionalProperties":false,"required":["type","sources"],"default":"void 0"},"fallbackBackgroundImageBright":{"type":"object","properties":{"type":{},"sources":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","description":"Image provider to be used with NuxtImage.\n\nIf you know the provider, e.g. `cloudinary`, `directus`, `sanity`, etc., you can use it here for optimal image-serving.\nOtherwise, the `raw` provider is a good fallback for plain URLs.\n\nAlternatively you can create a custom provider and use that here."},"src":{"type":"string"},"origin":{"type":"object","properties":{"libraryId":{"type":"string","description":"Producing library's id (the `.mediaLibrary()` registration id, default `meta.app`)."},"externalId":{"type":"string","description":"The asset's stable id within that library (Shopify gid, Shopware media UUID), when the backend has one."}},"additionalProperties":false,"required":["libraryId"],"description":"Origin of this source (producing library + stable external id)."},"width":{"type":"number"},"height":{"type":["number","undefined"]},"responsive":{"enum":["static","mobile","desktop"],"type":"string","description":"The responsiveness-mode of this source.\n- `static`: Source can be used for all viewport-sizes.\n- `mobile`: Source is a mobile-optimized version of the image.\n- `desktop`: Source is a desktop-optimized version of the image.\n\nIf not given, `static` can be assumed."},"focalPoint":{"description":"Optional focal point of the image, as fraction of the width and height of the image.\nIn form [x, y], e.g. [0.5, 0.5] for center.\n\nIf not given, center can be assumed."}},"additionalProperties":false,"required":["provider","src"]},"description":"Each source is a different version of the same image. Differences may be:\n- mobile or desktop version\n- different file-formats"},"placeholder":{"description":"Optional placeholder for the image.\n\nIf not given, the image will be loaded as is. Otherwise, the placeholder will be displayed while the image is loading."},"alt":{"type":["string","undefined"]},"meta":{},"aiDisclosure":{"enum":["generated","modified"],"type":"string","description":"AI disclosure for this asset, when the producing backend told us one.\nAbsent means no disclosure is known — there is nothing to disclose. It is\nnot an assertion that the asset is human-made.\n\nSet it only from an authoritative backend signal; never infer it from a\nfilename or guess. Omission is the correct answer for an unknown asset.\n\nDescribes the depicted content, so it is identical across every responsive\nvariant and format — which is why it lives here and not on the sources. A\nvideo's `poster` and an audio's `cover` are themselves images and carry\ntheir own, independent disclosure."}},"additionalProperties":false,"required":["type","sources"],"default":"void 0"},"backgroundImage":{"type":"object","properties":{"type":{},"sources":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","description":"Image provider to be used with NuxtImage.\n\nIf you know the provider, e.g. `cloudinary`, `directus`, `sanity`, etc., you can use it here for optimal image-serving.\nOtherwise, the `raw` provider is a good fallback for plain URLs.\n\nAlternatively you can create a custom provider and use that here."},"src":{"type":"string"},"origin":{"type":"object","properties":{"libraryId":{"type":"string","description":"Producing library's id (the `.mediaLibrary()` registration id, default `meta.app`)."},"externalId":{"type":"string","description":"The asset's stable id within that library (Shopify gid, Shopware media UUID), when the backend has one."}},"additionalProperties":false,"required":["libraryId"],"description":"Origin of this source (producing library + stable external id)."},"width":{"type":"number"},"height":{"type":["number","undefined"]},"responsive":{"enum":["static","mobile","desktop"],"type":"string","description":"The responsiveness-mode of this source.\n- `static`: Source can be used for all viewport-sizes.\n- `mobile`: Source is a mobile-optimized version of the image.\n- `desktop`: Source is a desktop-optimized version of the image.\n\nIf not given, `static` can be assumed."},"focalPoint":{"description":"Optional focal point of the image, as fraction of the width and height of the image.\nIn form [x, y], e.g. [0.5, 0.5] for center.\n\nIf not given, center can be assumed."}},"additionalProperties":false,"required":["provider","src"]},"description":"Each source is a different version of the same image. Differences may be:\n- mobile or desktop version\n- different file-formats"},"placeholder":{"description":"Optional placeholder for the image.\n\nIf not given, the image will be loaded as is. Otherwise, the placeholder will be displayed while the image is loading."},"alt":{"type":["string","undefined"]},"meta":{},"aiDisclosure":{"enum":["generated","modified"],"type":"string","description":"AI disclosure for this asset, when the producing backend told us one.\nAbsent means no disclosure is known — there is nothing to disclose. It is\nnot an assertion that the asset is human-made.\n\nSet it only from an authoritative backend signal; never infer it from a\nfilename or guess. Omission is the correct answer for an unknown asset.\n\nDescribes the depicted content, so it is identical across every responsive\nvariant and format — which is why it lives here and not on the sources. A\nvideo's `poster` and an audio's `cover` are themselves images and carry\ntheir own, independent disclosure."}},"additionalProperties":false,"required":["type","sources"]},"backgroundImageSizes":{"type":"string","default":"100vw"},"backgroundImageFit":{"enum":["cover","contain"],"type":"string","default":"void 0"},"surfaceTone":{"enum":["dark","light","bright"],"type":"string"},"overlay":{"type":"object","properties":{"variant":{"enum":["color","off","gradient","gradient-bottom"],"type":"string"},"opacity":{"type":"number"}},"additionalProperties":false}}}
```

#### Slots

```json
[{"name":"default","type":"{}","description":"","schema":{"kind":"object","type":"{}","schema":{}}}]
```
