Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Privacy-first YouTube embed with facade pattern. Zero iframe bytes until click — renders a thumbnail and play button, then swaps to the real player on interaction.
A lightweight YouTube embed that uses the facade pattern — renders a thumbnail image with a play button on page load, deferring the ~500 KB YouTube iframe until the user actually clicks play. Uses youtube-nocookie.com for privacy: no cookies are set until the user initiates playback.
Light DOM only (no shadow root), so design tokens and utility classes apply naturally.
Provide a YouTube video ID via video-id and an accessible title via title.
<youtube-player video-id="dQw4w9WgXcQ" title="Rick Astley — Never Gonna Give You Up"></youtube-player>
Apply the rounded class (inherited from the <video> native element vocabulary).
<youtube-player class="rounded" video-id="dQw4w9WgXcQ" title="Rick Astley — Never Gonna Give You Up"></youtube-player>
Wrap in a <figure> with <figcaption> for a captioned embed.
<figure> <youtube-player class="rounded" video-id="dQw4w9WgXcQ" title="Rick Astley — Never Gonna Give You Up"> </youtube-player> <figcaption>Never Gonna Give You Up — Rick Astley (1987)</figcaption></figure>
Pass a YouTube playlist ID via list. YouTube manages the playlist UI inside the iframe.
<youtube-player video-id="dQw4w9WgXcQ" list="PLbpi6ZahtOH6Ar_3GPy3j-g4s4zu4jOeJ" title="Playlist example"></youtube-player>
Use start to begin playback at a specific second.
<youtube-player video-id="dQw4w9WgXcQ" start="30" title="Starts at 30 seconds"></youtube-player>
| Attribute | Required | Type | Default | Description |
|---|---|---|---|---|
video-id | Yes | string | — | YouTube video ID |
title | Recommended | string | "Play video" | Accessible title for iframe and play button |
start | — | integer | — | Start playback at N seconds |
list | — | string | — | YouTube playlist ID |
params | — | string | — | Raw query string appended to embed URL (escape hatch) |
autoplay | — | boolean | false | Skip facade — load iframe immediately |
thumbnail | — | string | hq | Thumbnail resolution: hq, mq, sd, maxres |
| Attribute | Values | Description |
|---|---|---|
state | ready, active | Facade showing vs iframe loaded |
Inherited from the <video> native element vocabulary — no new classes invented.
| Class | Effect |
|---|---|
widescreen | 16:9 aspect ratio (default) |
standard | 4:3 aspect ratio |
ultrawide | 21:9 aspect ratio |
rounded | Border radius via --radius-m token |
full | inline-size: 100% |
Author an <a> fallback inside the element. Without JavaScript, the link takes the user to YouTube. Once the component upgrades, the facade replaces the link.
<!-- Without JS: renders as a plain link to YouTube --><youtube-player video-id="dQw4w9WgXcQ" title="Rick Astley — Never Gonna Give You Up"> <a href="https://youtu.be/dQw4w9WgXcQ"> Watch: Rick Astley — Never Gonna Give You Up </a></youtube-player>
| Scenario | Behaviour |
|---|---|
| No JS | Anchor link to YouTube visible |
| JS loaded | Facade: thumbnail + play button |
| User clicks | Iframe replaces facade, video autoplays |
autoplay | Iframe rendered immediately — no facade step |
alt="" (decorative — the button has the label)aria-label="Play {title}"tabindex="0" and role="button" in facade state for keyboard accesstitle attributeprefers-reduced-motion| Metric | Value |
|---|---|
| JS size | < 2 KB |
| CSS size | < 1 KB |
| Network requests before click | 1 (thumbnail image only) |
| YouTube cookies before click | None (youtube-nocookie.com) |
<video-player> — Self-hosted video with custom overlay controls<video> — Native video element (aspect-ratio classes shared with this component)<iframe> — Native iframe element