
Images
Add images to provide visual context, examples, or decoration to your documentation.Basic image syntax
Use Markdown syntax to add images to your documentation:images/screenshot.png in your repository, the path is /images/screenshot.png. Relative paths (for example, ./screenshot.png) are not supported.
Image files must be less than 20 MB. For larger files, host them on a CDN service like Amazon S3 or Cloudinary.
HTML image embeds
For more control over image display, use HTML<img> tags:
Resize images
Use Tailwind CSS classes to resize images. When no utility class covers the size that you need, use an arbitrary value such asw-[450px]:
style prop for sizing. It can cause a layout shift on page load.
Disable image zoom
To disable the default zoom on click for images, add thenoZoom property:
Link images
To make an image a clickable link, wrap the image in an anchor tag and add thenoZoom property:
Images within anchor tags automatically display a pointer cursor to indicate they are clickable.
Copy and download actions
Add copy and download controls to an image with theactions property. When enabled, buttons appear as an overlay on hover, focus, or touch, letting readers copy the image to their clipboard or save it to their device.
Set actions to true to show both buttons, or pass a comma-separated list to enable specific actions:
actions:
copy: Copy the image to the clipboard.download: Download the image as a file.
actionsPlacement property to position the buttons. The default is bottom-center.
actionsPlacement: bottom-center, bottom-left, bottom-right, top-center, top-left, top-right.
Light and dark mode images
To display different images for light and dark themes, use Tailwind CSS classes:Automatic image optimization
Mintlify optimizes images stored in your docs repository when it serves them. You don’t need to convert formats, generate multiple sizes, or set dimensions yourself. Optimization applies to images that you reference with a root-relative path, such as/images/screenshot.png. This includes Markdown images, <img> tags, image and icon properties on components, and the logo, background, and favicon in your docs.json.
For each optimized image, Mintlify:
- Serves AVIF or WebP to browsers that support them and the original format to browsers that don’t.
- Compresses the image and removes metadata, such as EXIF data.
- Generates resized versions up to 2500px wide so browsers download the smallest version that fits the page layout. Images are never scaled larger than the original.
- Adds the original width and height to the image so the page doesn’t shift while images load. If you set
widthorheighton an<img>tag, Mintlify uses your values instead.
- GIFs, so that animations keep working.
- SVG and ICO files.
- Images referenced with an absolute URL, such as images hosted on an external CDN.
- Images on pages that require authentication.
SVG images
SVG files that useforeignObject elements render differently in production than in local development. Mintlify’s image CDN strips foreignObject from SVGs as a security measure, which can truncate or hide text and other embedded HTML content.
This commonly affects SVGs exported from tools like draw.io that have HTML text formatting or word wrap turned on. To fix this, disable Formatted Text and Word Wrap on all labels in your diagram before exporting to SVG. See the draw.io documentation for more information on SVG exports.
Videos
Mintlify supports HTML tags in Markdown, giving you flexibility to create rich content.YouTube embeds
Embed YouTube videos using iframe elements:Self-hosted videos
Use the HTML<video> element for self-hosted video content:
Autoplay videos
To autoplay a video, use:When using JSX syntax, write double-word attributes in camelCase:
autoPlay, playsInline, allowFullScreen.Iframes
Embed external content using iframe elements:Related resources
Frame component reference
Learn how to use the Frame component for presenting images.