Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-lite-youtube-embed

> 前端框架
Open source

‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎< A private by default, faster and cleaner YouTube embed component for React applications />

381 stars0 likes0 views
WebsiteGitHub

About

‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎< A private by default, faster and cleaner YouTube embed component for React applications />

React Lite YouTube Embed


Why This Component?

YouTube's standard iframe embed adds over 500KB and makes dozens of network requests before the user even clicks play. This component fixes that:

  • ✅ Tiny – Under 5KB gzipped (JS + CSS)
  • ✅ Fast – Loads only a thumbnail until user clicks
  • ✅ Private – No YouTube cookies or tracking by default
  • ✅ SEO-Friendly – Structured data for search engines
  • ✅ Accessible – Full keyboard navigation and screen readers
  • ✅ TypeScript – Complete type definitions

Basic Usage

Install

bash
npm install react-lite-youtube-embed

Import and Use

typescript
import LiteYouTubeEmbed from 'react-lite-youtube-embed';
import 'react-lite-youtube-embed/dist/LiteYouTubeEmbed.css';

export default function App() {
  return (
    
  );
}

That's it! You now have a performant, private YouTube embed.


Pro Tips

Lazy Loading for Better Performance

typescript

Defers loading offscreen thumbnails, reducing bandwidth and improving mobile performance.

SEO with Structured Data

typescript

Enables JSON-LD VideoObject structured data for Google Rich Results.

Player Events

typescript
 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.

High Quality Thumbnails

typescript

Use maxresdefault for hero sections and featured content.


Documentation

Visit the full documentation →

  • Getting Started
  • API Reference - Complete props documentation
  • Live Examples - Interactive demonstrations
  • Code Examples - Copy-paste patterns
  • Performance Guide
  • Events Documentation

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

bash
# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

Security

This package includes:

  • ✅ SLSA Build Level 3 Provenance - Cryptographically signed builds
  • ✅ CodeQL Analysis - Automated security scanning
  • ✅ Dependency Audits - Regular security updates

Verify package authenticity:

bash
npm audit signatures

See .github/SLSA.md for more details.


License

MIT © Ibrahim Cesar

See LICENSE for full details.


Credits

  • Paul Irish (@paulirish) - Original Lite YouTube Embed
  • Addy Osmani (@addyosmani) - Adaptive Loading concepts

Resources

  • Full Documentation
  • npm Package
  • Report Issues
  • Changelog

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScripta11yadaptive-loadingiframeiframe-embeds

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架