Embed
Add responsive third-party media embeds to MDX pages without importing React components in every file.
Use embed components when the reader needs to watch a video, inspect a live demo, open a design preview, or review external media inline with the documentation.
YouTube
Use YouTube with an id prop. The value is the video ID from the YouTube URL, not the full URL.
Options
Pass the original mdx-embed options when you need more control.
Use skipTo when the useful part starts later in the video.
X / Twitter
Use Tweet when a post is the source material for the explanation. Pass the full tweet URL to tweetLink.
Vimeo
Use Vimeo for hosted product videos, tutorials, talks, or walkthroughs that should stay embedded in the page.
CodePen
Use CodePen for small front-end demos where readers need to inspect the result and source together.
CodeSandbox
Use CodeSandbox for larger runnable examples that need a full project environment.
Figma
Use Figma when the documentation needs to reference a design file, frame, or component spec.
Spotify
Use Spotify for podcast episodes, playlists, or audio references that belong directly in the page flow.
SoundCloud
Use SoundCloud for hosted audio clips, interviews, or previews that are easier to play inline.
Replit
Use Replit for examples readers can run or remix without leaving the docs.
Supported Props
YouTube, Vimeo, CodePen, and CodeSandbox support a short id prop. The wrapper maps it to the original mdx-embed prop internally.
| Component | Short prop | Original prop |
|---|---|---|
YouTube | id | youTubeId |
Vimeo | id | vimeoId |
CodePen | id | codePenId |
CodeSandbox | id | codeSandboxId |
Embeds load external content from the provider. Use them only when the embedded media is part of the page's explanation, not as decoration.