
Company News
Socket Joins the OpenJS Foundation
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.
react-lite-youtube-embed
Advanced tools
A private by default, faster and cleaner YouTube embed component for React applications
Private, performant YouTube embeds for React. Under 5KB gzipped.
Complete guides, live examples, and API reference
YouTube's standard iframe embed adds over 500KB and makes dozens of network requests before the user even clicks play. This component fixes that:
npm install react-lite-youtube-embed
import LiteYouTubeEmbed from 'react-lite-youtube-embed';
import 'react-lite-youtube-embed/dist/LiteYouTubeEmbed.css';
export default function App() {
return (
<LiteYouTubeEmbed
id="dQw4w9WgXcQ"
title="Rick Astley - Never Gonna Give You Up"
/>
);
}
That's it! You now have a performant, private YouTube embed.
<LiteYouTubeEmbed
id="VIDEO_ID"
title="Video Title"
lazyLoad={true}
/>
Defers loading offscreen thumbnails, reducing bandwidth and improving mobile performance.
<LiteYouTubeEmbed
id="VIDEO_ID"
title="Video Title"
seo={{
name: "Full Video Title",
description: "Video description for search engines",
uploadDate: "2024-01-15T08:00:00Z",
duration: "PT3M33S"
}}
/>
Enables JSON-LD VideoObject structured data for Google Rich Results.
<LiteYouTubeEmbed
id="VIDEO_ID"
title="Video Title"
enableJsApi
onPlay={() => console.log('Video started')}
onPause={() => console.log('Video paused')}
onEnd={() => console.log('Video finished')}
/>
React to player state changes for analytics, auto-advancing playlists, and more.
<LiteYouTubeEmbed
id="VIDEO_ID"
title="Video Title"
poster="maxresdefault"
/>
Use maxresdefault for hero sections and featured content.
📚 Visit the full documentation →
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Install dependencies
npm install
# Run tests
npm test
# Build
npm run build
This package includes:
Verify package authenticity:
npm audit signatures
See .github/SLSA.md for more details.
MIT © Ibrahim Cesar
See LICENSE for full details.
Made with 🧩 in Brazil 🇧🇷
FAQs
A private by default, faster and cleaner YouTube embed component for React applications
The npm package react-lite-youtube-embed receives a total of 91,521 weekly downloads. As such, react-lite-youtube-embed popularity was classified as popular.
We found that react-lite-youtube-embed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.