Skip to main content
Docus provides multiple ways to include visual content in your documentation, from simple images to embedded videos and interactive media.

Images

Basic Image Syntax

Use standard Markdown syntax to include images:
![Nuxt Social Image](https://nuxt.com/new-social.jpg)
Result: Nuxt Social Image

Local Images

Reference images stored in your project’s public directory:
![Mountain landscape](/images/mountains.webp)
Docus uses the <NuxtImg> component under the hood instead of the native img tag, providing automatic optimization and lazy loading.

Image Optimization

Docus integrates with Nuxt Image for automatic image optimization:
  • Automatic format conversion - WebP and AVIF support
  • Responsive images - Multiple sizes for different screens
  • Lazy loading - Images load as users scroll
  • Blur placeholder - Smooth loading experience
Place images in the public/ directory to reference them with absolute paths starting with /.

Image Sizing

Control image dimensions using HTML attributes:
<img src="/images/logo.svg" alt="Logo" width="200" height="100" />
Or use the MDC syntax:
:img{src="/images/logo.svg" alt="Logo" width="200"}

Videos

Embedded Videos

Embed videos using the MDC video component:
:video{autoplay controls loop src="https://example.com/video.mp4"}
Supported video formats include MP4, WebM, and OGG. Always provide a controls attribute for better accessibility.

Video Attributes

Common video attributes:
AttributeDescription
autoplayStart playing automatically
controlsShow playback controls
loopLoop the video
mutedMute audio (required for autoplay)
posterThumbnail image before video plays
Autoplay videos should always be muted to comply with browser policies and provide a better user experience.

YouTube Embeds

Embed YouTube videos using the standard iframe syntax or MDC component:
<iframe 
  width="560" 
  height="315" 
  src="https://www.youtube.com/embed/dQw4w9WgXcQ" 
  title="YouTube video" 
  frameborder="0" 
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
  allowfullscreen
></iframe>
Use YouTube’s “Share” → “Embed” option to get the correct iframe code with privacy-enhanced mode.

CodePen Embeds

Embed CodePen examples for interactive code demonstrations:
<iframe 
  height="400" 
  style="width: 100%;" 
  scrolling="no" 
  title="Example Pen" 
  src="https://codepen.io/username/embed/penid?default-tab=html,result" 
  frameborder="no" 
  loading="lazy" 
  allowtransparency="true" 
  allowfullscreen="true"
>
</iframe>

Twitter/X Embeds

Embed tweets using Twitter’s embed code:
<blockquote class="twitter-tweet">
  <p lang="en" dir="ltr">Tweet text here</p>
  <a href="https://twitter.com/user/status/123456">Date</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

GitHub Gists

Embed GitHub Gists for code snippets:
<script src="https://gist.github.com/username/gist-id.js"></script>

Interactive Embeds

Embed Figma prototypes:
<iframe 
  style="border: 1px solid rgba(0, 0, 0, 0.1);" 
  width="800" 
  height="450" 
  src="https://www.figma.com/embed?embed_host=share&url=YOUR_FIGMA_URL" 
  allowfullscreen
></iframe>

Image Galleries

Create image galleries using card groups:
<CardGroup cols={2}>
  <Card>
    ![Image 1](/images/example-1.jpg)
  </Card>
  <Card>
    ![Image 2](/images/example-2.jpg)
  </Card>
  <Card>
    ![Image 3](/images/example-3.jpg)
  </Card>
  <Card>
    ![Image 4](/images/example-4.jpg)
  </Card>
</CardGroup>
::card-group
  :::card
  ![Image 1](/images/example-1.jpg)
  :::
  :::card
  ![Image 2](/images/example-2.jpg)
  :::
::

SVG Images

SVG files work perfectly in documentation:
![Logo](/logo.svg)
SVG images scale perfectly at any size and support transparency, making them ideal for logos and diagrams.

Accessibility Best Practices

Every image should have descriptive alt text for screen readers:
![A developer writing code on a laptop](/developer.jpg)
Name files descriptively: authentication-flow.png instead of img123.png
For complex diagrams, include explanatory captions below the image.
For important video content, provide text transcripts or summaries.

Performance Optimization

Choose the right format:
  • JPEG - Photos and complex images
  • PNG - Images with transparency
  • WebP - Modern format with better compression
  • SVG - Logos, icons, and simple graphics

CDN and External Images

When using external images, consider:
External images from third-party CDNs may:
  • Slow down page load times
  • Introduce privacy concerns
  • Become unavailable if the external source goes down
Whenever possible, host critical images in your project.

Image Organization

Organize your images effectively:
public/
├── images/
│   ├── screenshots/
│   │   ├── dashboard.png
│   │   └── settings.png
│   ├── diagrams/
│   │   ├── architecture.svg
│   │   └── workflow.svg
│   └── logos/
│       ├── logo.svg
│       └── logo-dark.svg
Use a consistent naming convention and directory structure to make images easy to find and maintain.

Build docs developers (and LLMs) love