Videos and iframes
Reference for embedding videos and iframes using the editor UI and the Video / Iframe components.
Overview
Embed videos from platforms like YouTube, Vimeo, and Loom, or use self-hosted video files and interactive iframes.
You can work with rich media in two ways:
-
Editor UI: Paste a video URL or embed code and resize/align visually.
-
MDX: Use the
<Video>and<Iframe>components directly.
Add videos and embeds from the editor UI (recommended)
Insert a video or iframe
-
Place your cursor on a new line in the editor.
-
Type / and select Video.
-
In the Video URL or Embed Code dialog, paste either:
-
A video URL (YouTube, Vimeo, Loom, MP4 URL, etc.), or
-
An
<iframe>embed code from your video platform or other tool.
-
-
Click Insert Video. The video/iframe appears in your document.
Align and resize
Hover over the embedded video to reveal controls:
-
Top-right toolbar
-
Alignment icon: Change alignment (for example, left, center, or right), similar to images.
-
Other actions: May include zoom or delete, depending on configuration.
-
-
Side drag handles
-
Handles on the left and right edges let you adjust the width of the video.
-
The height adjusts automatically to maintain the original aspect ratio.
-
Use this UI for both direct video URLs and <iframe> embed codes.

Use the Video component in MDX
Embed videos from platforms like YouTube, Vimeo, and Loom, or use self-hosted video files. The Video component handles both iframe embedding and HTML5 video playback.
Common use cases:
-
Platform videos (YouTube, Vimeo, Loom)
-
Self-hosted video files (MP4, WebM)
-
Interactive content and external applications
Video (iframe mode)
Use this mode for YouTube, Vimeo, Loom, and other video platforms that provide an embed URL.
<Video
src="https://www.youtube.com/embed/Reu01KxMSF0?si=Rf3PTfKp1hMn9qhX"
title="YouTube video player"
width="560"
height="315"
/>
Attributes
Video embed URL from platform.
Video player width in pixels.
Video player height in pixels.
Accessible title for screen readers.
Allow content to go fullscreen (default: true).
Load immediately instead of lazy loading (default: false).
CSS styles for alignment and positioning.
Video (HTML5 mode)
Use for self-hosted video files (MP4, WebM, OGG) with native browser controls.
<Video
src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
width="560"
height="315"
controls="true"
poster="https://example.com/thumbnail.jpg"
/>
Attributes
Direct URL to video file (MP4, WebM, OGG).
Video player width in pixels.
Video player height in pixels.
Show video controls (default: true).
Auto-play video when page loads (default: false).
Start video muted (default: false).
Loop video continuously (default: false).
Image URL to display before video starts playing.
How much video to preload: none, metadata, auto.
Browser loading priority: high, low, auto.
CSS styles for alignment and positioning.
Iframe component in MDX
Use <Iframe> for embedding external content such as forms, dashboards, or interactive tools.
<Iframe
src="https://docs.google.com/forms/d/e/1FAIpQLSexample/viewform"
title="Feedback form"
width="100%"
height="600"
/>
Attributes
URL of external content to embed.
Iframe width (pixels or percentage).
Iframe height (pixels or percentage).
Accessible title for screen readers.
Allow content to go fullscreen (default: true).
Security restrictions (default: "allow-scripts allow-same-origin allow-presentation").
Load immediately instead of lazy loading (default: false).
CSS styles for alignment and positioning.
Platform support & best practices
Video platforms: YouTube, Vimeo, Loom, Wistia
Video formats: MP4, WebM, OGG
-
Use clear, descriptive titles for accessibility.
-
Specify
widthandheightto improve layout stability. -
Use
priority/fetchPriorityonly for above-the-fold media. -
Prefer the editor UI for quick embeds; switch to MDX components when you need full control.
Last updated 1 day ago