Looking for the old docs? Go here

Display

Poster

This component is used to display a media poster or thumbnail image, generally before playback begins.

Some server frameworks such as Astro and Next.js provide an <Image> component for creating and displaying optimized versions of local images. This can be useful when creating poster images, use the asChild property to pass in the optimized image.

    
    
HTMLAttributes<HTMLImageElement>
Ref<HTMLImageElement>

Loads and displays the current media poster image. By default, the media provider's loading strategy is respected meaning the poster won't load until the media can.

import { Poster, type PosterProps } from "@vidstack/react";
<MediaPlayer>
  <MediaProvider>
    <Poster src="..." alt="..." />
  </MediaProvider>
</MediaPlayer>
PropTypeDefault
alt
string
undefined
asChild
boolean
false
children
ReactNode
null
crossOrigin
mixed
null
src
string
null
/* Example. */
.component[data-foo] {}
NameDescription
data-visible
Whether poster image should be shown.
data-loading
Whether poster image is loading.
data-error
Whether an error occurred loading poster.
data-hidden
Whether poster has no src or has failed to load.