Overview
The Embed plugin provides a universal solution for embedding external content from various platforms. It supports video providers, social media, code sandboxes, music services, and maps — all with automatic URL detection and proper aspect ratio handling.Installation
Basic Usage
Pass the plugin tocreateYooptaEditor; do not pass plugins to <YooptaEditor>.
Features
- Universal Embedding: Embed content from 13+ platforms with a single plugin
- Auto URL Detection: Automatically detects provider from pasted URLs
- Provider-specific Aspect Ratios: Each provider uses its optimal aspect ratio
- Resizable: Resize embeds while maintaining aspect ratio
- oEmbed Support: Fetches metadata from providers that support oEmbed
- Responsive: Automatically adapts to container width
Supported Providers
YouTube
Videos, Shorts
Vimeo
Videos
Twitter/X
Tweets, Posts
Posts, Reels
Spotify
Tracks, Albums, Playlists
SoundCloud
Tracks, Sets
Figma
Files, Prototypes
CodePen
Pens
CodeSandbox
Sandboxes
Loom
Videos
Dailymotion
Videos
Wistia
Videos
Google Maps
Maps, Places
Configuration
Options
Maximum width for embedded content in pixels
Default dimensions for embeds when aspect ratio cannot be determined
Element Props
Provider information for the embedded content:
Embed dimensions:
{ width: number, height: number }Provider Types
Commands
Utility Functions
The Embed plugin exports utility functions for working with embed URLs:URL Patterns
Each provider supports specific URL patterns:YouTube
Vimeo
Twitter/X
Spotify
Figma
CodePen
CodeSandbox
Hooks
useEmbedUrl
Parse URLs and fetch oEmbed data:Custom Rendering
With Shadcn Theme
Parsers
HTML Deserialization
The plugin automatically deserializes<iframe> elements with supported URLs:
data-yoopta-embed attribute:
HTML Serialization
Markdown Serialization
Embeds are serialized as links in Markdown:Email Serialization
For email clients that don’t support iframes, embeds are rendered as clickable thumbnails (when available) or placeholder links:Aspect Ratios
Each provider has its optimal aspect ratio:| Provider | Aspect Ratio |
|---|---|
| YouTube | 16:9 |
| Vimeo | 16:9 |
| Dailymotion | 16:9 |
| Loom | 16:9 |
| Wistia | 16:9 |
| Figma | 16:9 |
| CodePen | 16:9 |
| CodeSandbox | 16:9 |
| Google Maps | 16:9 |
| 550:600 | |
| 1:1 | |
| Spotify | 300:380 |
| SoundCloud | 100:166 |
Use Cases
Blog Posts
Embed YouTube tutorials, Spotify playlists, or tweets
Documentation
Include Figma designs, CodePen demos, or Loom walkthroughs
Portfolio
Showcase Vimeo videos, Dribbble shots, or CodeSandbox projects
Social Content
Embed Instagram posts, Twitter threads, or TikTok videos
Music & Audio
Include Spotify tracks, SoundCloud sets, or podcast episodes
Development
Share CodePen experiments, CodeSandbox demos, or GitHub gists
Best Practices
Use Appropriate Providers
Use Appropriate Providers
Choose the right provider for your content type. Use Video plugin for self-hosted videos, Embed plugin for third-party content.
Consider Loading Performance
Consider Loading Performance
Embeds load external content which can affect page performance. Consider lazy loading for content-heavy pages.
Provide Fallbacks
Provide Fallbacks
Some embeds may not load due to privacy settings or content restrictions. Consider providing fallback content or links.
Respect Content Policies
Respect Content Policies
Some platforms have embedding restrictions. Check provider policies for commercial use.
Set Reasonable Max Widths
Set Reasonable Max Widths
Configure appropriate maxWidth for your design to maintain consistency across embed types.
Troubleshooting
URL not detected
URL not detected
If a URL is not being detected, check:
- The URL format matches supported patterns
- The URL is from a supported provider
parseEmbedUrl utility to debug:Embed not displaying
Embed not displaying
Some content may be blocked due to:
- Content is private or restricted
- Platform blocks embedding from your domain
- CORS restrictions
Wrong aspect ratio
Wrong aspect ratio
If the aspect ratio looks wrong:
- The provider may have changed their default dimensions
- The content may have a non-standard aspect ratio
oEmbed data not loading
oEmbed data not loading
Not all providers support oEmbed. The plugin will still work but may not have:
- Thumbnail images
- Title/description metadata
- Author information
Embed vs Video Plugin
| Feature | Embed Plugin | Video Plugin |
|---|---|---|
| Self-hosted videos | ❌ | ✅ |
| YouTube/Vimeo | ✅ | ✅ |
| File upload | ❌ | ✅ |
| Social media | ✅ | ❌ |
| Code sandboxes | ✅ | ❌ |
| Music services | ✅ | ❌ |
| Maps | ✅ | ❌ |
| Playback settings | ❌ | ✅ |
| Poster images | ❌ | ✅ |
Related Plugins
- Video Plugin - For self-hosted videos and video providers with playback controls
- Image Plugin - For image content
- File Plugin - For file attachments

