The Embed component allows you to include local assets directly in your documentation. This is useful for displaying PDFs, images, videos, OpenAPI files, and other media files.

Properties

src
stringRequired

Path to your local asset (relative to current MDX file)

type
stringRequired

MIME type of the asset (e.g. ‘video/mp4’, ‘application/pdf’)

width
string | number

Width of the embedded content. Can be a number (interpreted as pixels) or a string with CSS units (e.g. ‘100%’, ‘500px’, ‘50vw’)

height
string | number

Height of the embedded content. Can be a number (interpreted as pixels) or a string with CSS units (e.g. ‘500px’, ‘80vh’)

1<embed src="./path/to/asset.pdf" type="application/pdf" />

Examples

Video File

Videos with audio will automatically play when the page loads. If you want to prevent this behavior, consider using the <video> component instead, which provides more control over playback.

PDF Document

Common MIME Types

File TypeMIME Type
PDFapplication/pdf
MP4 Videovideo/mp4
WebM Videovideo/webm
SVG Imageimage/svg+xml
PNG Imageimage/png
JPEG Imageimage/jpeg

The supported file types and behavior may vary depending on the browser and the type of content being embedded. For video files, consider using MP4 format for maximum compatibility.

Built with