Images and Video

Insert remote or local images with Markdown image syntax, provide separate light and dark screenshots with u-color-mode-image, and embed videos with :video. Also covers where to put images and how to write alt text.
View source

Images

Remote images

![Nuxt social image](https://nuxt.com/new-social.jpg)

Local images

Put local images in the site's public/ directory and reference them from /:

![Snowy mountains in a sea of clouds at sunset](/mountains.webp)
Markdown images use <NuxtImg>. The project's image.provider determines how images are optimized. This site uses the none provider on Cloudflare Workers to serve the original image URLs.

The alt text in square brackets describes the image for screen readers and search engines. Avoid empty words such as "image" or "screenshot".

Light and dark screenshots

When a UI screenshot looks very different in light and dark mode, provide both with u-color-mode-image; the page shows the one matching the current theme:

Home page of the @movk/nuxt docs site
:u-color-mode-image{light="/assets/templates/movk-nuxt-light.png" dark="/assets/templates/movk-nuxt-dark.png" alt="Home page of the @movk/nuxt docs site" class="rounded-md border border-default"}
Keep both images the same size so the page does not shift when the theme changes.

Video

:video renders a native <video> element with the usual HTML attributes:

:video{autoplay controls loop muted src="https://media.w3.org/2010/05/sintel/trailer.mp4"}

Browsers only autoplay muted videos, so add muted together with autoplay.

Copyright © 2024 - 2026