Embed media in
your Svelte apps.
A collection of 21 embed components I use on a regular basis, packaged up for use: videos, podcasts, social posts and code. They work in Svelte files and in Markdown with mdsvex, which is how this site is written.
Edit the ID, the embed follows. All YouTube props
Install and use
Add the package to a SvelteKit project. It needs Svelte 5.29 or later.
1pnpm add -D sveltekit-embedImport the component you need and give it an ID or a link.
1<script>
2 import { YouTube } from 'sveltekit-embed';
3</script>
4
5<YouTube youtube_id="dQw4w9WgXcQ" />It works the same way in Markdown with mdsvex, which is how the pages on this site are written.
1<script>
2 import { YouTube } from 'sveltekit-embed';
3</script>
4
5# My post
6
7<YouTube youtube_id="dQw4w9WgXcQ" />Embeds load when they get close to the viewport. To change that, or to lazy load your own markup, read how lazy loading works.
Components
Missing one? Request an embed or use GenericEmbed.
Video 3
Audio and podcasts 7
- AnchorFm A podcast episode from Anchor, now Spotify for Creators.
- Buzzsprout A Buzzsprout podcast episode player.
- Deezer A Deezer show, album, playlist or track.
- SimpleCast A Simplecast podcast episode player.
- SoundCloud A SoundCloud track or set.
- Spotify A Spotify show, episode, album, playlist or track.
- Zencastr A Zencastr podcast episode player.
Social posts 4