YouTube Embed

A YouTube video as a click-to-play facade. At rest it is only the video's thumbnail and a play button; YouTube's player (~500KB of script, plus its cookies) loads from the privacy-enhanced youtube-nocookie domain when the visitor presses play. Used as the Lab project hero and as the YouTube block in any Sanity body (blog posts, case studies, Lab projects).

Default

tsx
<YouTubeEmbed
  url="https://www.youtube.com/watch?v=d5TxsqD-7Mw"
  title="Usability Test MCP: usability tests right from Claude Code or Codex"
/>

In Sanity

Add a YouTube video block to any body, or fill the Video field on a Lab project. Both take the URL and an optional title; Studio rejects links that aren't youtube.com or youtu.be.

Props

PropTypeDefaultDescription
url*string-Any YouTube link — watch, youtu.be, shorts or embed. Renders nothing if the link cannot be parsed.
titlestring-Video title. Names the play button ("Play video: …") and the player iframe for screen readers.
prioritybooleanfalseLoads the thumbnail eagerly. Set it when the video is above the fold (the Lab project hero).
sizesstring"(min-width: 1024px) 1040px, 100vw"Thumbnail sizes hint; the default matches .article-column.
classNamestring-Additional classes for the 16:9 frame