React Lite YouTube Embed
A faster and cleaner YouTube embed component for React: 1.4kB minified, 699B minified + gzipped.
Port of Paul Irish's Lite YouTube Embed to a React Component. Provide videos with a supercharged focus on visual performance. The gain is not the same as the web component of the original implementation but saves some requests and gives you more control of the embed visual. An "Adaptive Loading" way to handle iframes for YouTube.
Version 2.0 - BREAKNG CHANGE
To play nice with new frameworks like NextJS, we now don't import the .css
necessary. Instead in order to use now you have three options:
Option 1
Manual import our file in your React application this way:
Option 2
Place the necessary CSS in your Global CSS file
Option 3
Using your CSS-In-JS tool of choice encapsulate this component and use the css provided as a guide.
Installation
Use your favorite package manager:
Basic usage
And that's it.
Pro Usage
Bring Your Own Styles
React Lite YouTube Embed is packaged with all original styles from Paul Irish's Lite YouTube Embed but you can customize them as you wish passing as a props.