Video

A responsive YouTube video component that displays a thumbnail until clicked.

The component displays a thumbnail image with a play button overlay. When clicked, the thumbnail is replaced with a YouTube iframe that autoplays the video. In an ideal world, the player would be loaded only when the user clicks the custom play button. But then autoplay does not work reliably on iOS.

Each Video component instance will load and initialize a YouTube iframe immediately when it is mounted, even if the video is never played. This can have performance implications if you use multiple Video components on a single page, as each will load a separate iframe and associated resources. When the user clicks the play button, the already initialized player is shown and the video starts playing.

Props

A Video component has the following properties:

PropRequiredDescription
idyesYouTube video ID.
aspectRationoOverride default aspect ratio of 16:9.
titlenoOverride title from YouTube.
classnoAdditional classes.

Examples

Default aspect ratio

YouTube video

4:3 aspect ratio

YouTube video