Skip to main content

Media Hero YouTube

A MediaHeroYouTube displays a YouTube video with an optional placeholder image.

Example

Play
Media Card Youtube image

Variants

Use theicon above to preview
VariantDescriptionValues
MediaHero.paddingTop
  • regular
  • extra
MediaHero.paddingBottom
  • regular
  • extra
MediaHero.height
  • default
  • hero
  • banner

Customization

Approach for customization will vary depending on if the change is intended to be global for all consumers of the ui component or if it is only an override for a particular instance.

  • If the customization is necessary for all users, update the source code of in the ui component library directly.
  • Otherwise, you can pass className overrides.

Say you wanted a YouTube Media Hero with a height of 240 pixels:

<MediaHeroYouTube {...variants} className='h-60'>
<MediaHeroYouTubeBackground>
<YouTubePlayer {...mockYoutube}>
<YouTubePlayerText>Play</YouTubePlayerText>
{placeholderImage && (
<YouTubePlayerImage asChild>
<img {...placeholderImage} src={placeholderImage.src} />
</YouTubePlayerImage>
)}
</YouTubePlayer>
</MediaHeroYouTubeBackground>
</MediaHeroYouTube>