Skip to content
Documentation
Packages
nextra-theme-docs
Writing Content
Images and Embeds

Images and Embeds

Add image, video, and other HTML elements

Image
Permalink for this section

Using Markdown
Permalink for this section

The markdown syntax (opens in a new tab) lets you add images using the following code


![title](/path/image.jpg)

Using Embeds
Permalink for this section

To get more customizability with images, you can also use embeds to add images


<img height="200" src="/path/image.jpg" />

Related
Permalink for this section

For more information, we recommend the following sections:

Frame Component Reference

Read the reference for the Frame component

Videos and other HTML elements
Permalink for this section

Nextra supports HTML tags in Markdown (opens in a new tab). This is helpful if you prefer HTML tags to Markdown syntax, and lets you create documentation with infinite flexibility.

Videos
Permalink for this section

For YouTube videos use:


<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/lJIrF4YjHfQ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
/>

For other videos, use:


<video controls className="w-full aspect-video" src="link-to-your-video.com"></video>

iFrames
Permalink for this section

Loads another HTML page within the document.


<iframe src="https://www.youtube.com/embed/lJIrF4YjHfQ"></iframe>

To have videos autoplay, add autoplay = {true}.

You can also upload your videos to storage services like Cloudinary to reference them in your Nextra documentation!

Line Breaks
Permalink for this section

Add a linebreak


<br />

Although not required, we recommend adding the alt and title attributes to images for better SEO and accessability. Learn more at image SEO (opens in a new tab).