Images
Basic Image Syntax
Use standard Markdown syntax to include images:
Local Images
Reference images stored in your project’s public directory: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
Image Sizing
Control image dimensions using HTML attributes:Videos
Embedded Videos
Embed videos using the MDC video component:Supported video formats include MP4, WebM, and OGG. Always provide a
controls attribute for better accessibility.Video Attributes
Common video attributes:| Attribute | Description |
|---|---|
autoplay | Start playing automatically |
controls | Show playback controls |
loop | Loop the video |
muted | Mute audio (required for autoplay) |
poster | Thumbnail image before video plays |
YouTube Embeds
Embed YouTube videos using the standard iframe syntax or MDC component:CodePen Embeds
Embed CodePen examples for interactive code demonstrations:Twitter/X Embeds
Embed tweets using Twitter’s embed code:GitHub Gists
Embed GitHub Gists for code snippets:Interactive Embeds
- Figma
- Loom
- Miro
Embed Figma prototypes:
Image Galleries
Create image galleries using card groups:SVG Images
SVG files work perfectly in documentation:Accessibility Best Practices
Always include alt text
Always include alt text
Every image should have descriptive alt text for screen readers:
Use descriptive filenames
Use descriptive filenames
Name files descriptively:
authentication-flow.png instead of img123.pngProvide captions when needed
Provide captions when needed
For complex diagrams, include explanatory captions below the image.
Include video transcripts
Include video transcripts
For important video content, provide text transcripts or summaries.
Performance Optimization
- Image Formats
- File Size
- Loading Strategy
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