About
A lazy-loading YouTube video embed that shows a poster image and play button until clicked, then loads the iframe and lets you control playback (play, pause, mute, seek) through a ref.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds YouTube Embed to your project and fits it to your theme.
Code
How YouTube Embed is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { YouTubeEmbed } from "@/components/ui/youtube-embed";
export default function YouTubeEmbedDemo() {
return (
<div className="w-full max-w-2xl mx-auto p-4">
<YouTubeEmbed
videoId="dQw4w9WgXcQ"
title="Rick Astley - Never Gonna Give You Up"
/>
</div>
);
}








