Component usage
Add a YouTube video to your home page:Variables
The YouTube video ID found in the video URL. For example, in
https://www.youtube.com/watch?v=dQw4w9WgXcQ, the ID is dQw4w9WgXcQSorting number for the component placement on the page (starts from zero)
Example
Lite YouTube element
The component uses thelite-youtube custom element which provides:
- Lazy loading: Video loads only when clicked
- Fast initial page load: No heavy YouTube iframe until needed
- Thumbnail preview: Shows video thumbnail before loading
- Reduced data usage: Video only downloads when user initiates playback
Parameters
Theparams attribute accepts YouTube embed parameters:
rel=0- Disables related videos from other channels at the endautoplay=1- Enables autoplay (requires user interaction)controls=0- Hides video controlsstart=30- Starts video at specified second
The lite-youtube component significantly improves page load performance by deferring the YouTube iframe until the user clicks play.
Configuration in twilight.json
This component is registered intwilight.json under features: