Skip to main content Home About the Design SystemRoadmap OverviewDesignersDevelopers OverviewColorGridIconographyInteractionsSpacingTypography Overview Global colorBox shadowTypographyBorderOpacitySpaceLengthIconBreakpointsMedia queries All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button group Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Menu dropdown Navigation link Navigation (primary) Navigation (secondary) Navigation (vertical) Pagination PopoverPlanned Progress stepper Readtime Scheme toggle Select Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed OverviewColor PalettesCustomizingDevelopers All PatternsAccordionAlertCall to ActionCardFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTabsTagTile All Personalization PatternsAnnouncement FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers Design/code status Release notes Get support

Video embed

OverviewStyleGuidelinesCodeAccessibilityDemos
OverviewStatusWhen to useStatus checklistOverviewStatusWhen to useStatus checklist

Overview

A video embed provides an accessible preview of a YouTube video with a thumbnail and play button. Users must provide an iframe inside a <template> with a title for screen reader users. Should include a thumbnail with alt text. Supports Tab and Enter keyboard focus. Uses aria-hidden on the thumbnail when active. Avoid videos without captions.

import '@rhds/elements/rh-video-embed/rh-video-embed.js';
<rh-video-embed>
  <img slot="thumbnail" src="video-thumb.jpg" alt="Image description">
  <template>
    <iframe title="Title of video" width="900" height="499" src="https://www.youtube.com/embed/Hc8emNr2igU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
  </template>
  <p slot="caption"><a class="rh-video-embed-caption-link" href="https://www.redhat.com/">View the infographic</a></p>
</rh-video-embed>
import { VideoEmbed } from "@rhds/elements/react/rh-video-embed/rh-video-embed.js";

// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.

export const Demo = () => (
  <VideoEmbed>
    <img slot="thumbnail" src="video-thumb.jpg" alt="Image description" />
    <template />
    <p slot="caption">
      <a className="rh-video-embed-caption-link" href="https://www.redhat.com/">View the infographic</a>
    </p>
  </VideoEmbed>
);

Add to rh-video-embed when a video requires consent for cookies

Boolean flag to flip with JavaScript when cookie consent has been granted or revoked. See the Require Consent demo for reference.

View source on GitHub

Status

When to use

  • When you need to embed a YouTube video on a page
  • When you want a faster YouTube embed
  • When you don’t want to load several megabytes of JavaScript for a YouTube embed
Red Hat Logo on a gray background

Status checklist

© 2026 Red Hat Deploys by Netlify