Jamdesk Documentation logo

Media & Embeds

Add images, YouTube videos, and iframes to your docs. Includes dimension syntax, dark mode images, and Frame captions.

Jamdesk styles images, video embeds, and iframes automatically with rounded corners and consistent framing.

Images

Standard Markdown

The simplest way to add an image:

![Alt text describing the image](/images/tabs-preview.png)

Place images in your /images directory and reference them with absolute paths.

Image Dimensions

Control image size by appending dimensions after the URL:

![Screenshot](/images/screenshot.png =400x300)

The syntax is =WIDTHxHEIGHT with a space before the equals sign.

Width only (height auto-scales):

![Wide banner](/images/banner.png =800x)

Height only (width auto-scales):

![Tall graphic](/images/sidebar.png =x200)

With Captions

Use the Frame component to add a border and optional caption:

<Frame caption="Dashboard overview showing project statistics">

  ![Dashboard](/images/tabs-preview.png)

</Frame>

Jamdesk

Example of a framed image with caption

Light/Dark Mode Images

Show different images based on the user's color scheme:

<img
  src="/_jd/images/logo-light.webp?v=mml1g89b"
  srcDark="/images/logo-dark.webp"
  alt="Company logo"
/>

Or use the HTML picture element:

<picture>
  <source srcset="/images/logo-dark.webp" media="(prefers-color-scheme: dark)" />
  <img src="/_jd/images/logo-light.webp?v=mml1g89b" alt="Company logo" />
</picture>

Video Embeds

Videos get the same rounded-corner styling as images.

YouTube

The simplest way to embed YouTube videos is with the <YouTube> component:

<YouTube id="dQw4w9WgXcQ" />

Just pass the video ID from the YouTube URL (the part after v=). The component automatically:

  • Lazy-loads the video player (only loads when clicked)
  • Disables related videos at the end
  • Applies consistent rounded styling

Props

PropTypeDescription
idstringYouTube video ID (required)
titlestringAccessibility label for the play button
startnumberStart time in seconds

Start at a specific time

Use the start prop to begin playback at a specific point:

<YouTube id="dQw4w9WgXcQ" start={60} />

This starts the video at 1 minute (60 seconds).

To find the video ID, look at the YouTube URL: youtube.com/watch?v=VIDEO_ID or youtu.be/VIDEO_ID

Using iframes directly

For more control, you can embed YouTube videos using an iframe:

<iframe
  className="w-full aspect-video rounded-xl"
  src="https://www.youtube.com/embed/VIDEO_ID"
  title="YouTube video player"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  allowFullScreen
/>

The <YouTube> component is recommended over raw iframes because it lazy-loads the player, improving page load performance.

Vimeo

Embed Vimeo videos similarly:

<iframe
  className="w-full aspect-video rounded-xl"
  src="https://player.vimeo.com/video/VIDEO_ID"
  title="YouTube video player"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  allowFullScreen
/>

Responsive Videos

For fully responsive videos that maintain aspect ratio:

<div style={{position: 'relative', paddingBottom: '56.25%', height: 0, overflow: 'hidden'}}>
  <iframe
  className="w-full aspect-video rounded-xl"
  src="https://www.youtube.com/embed/VIDEO_ID"
  title="YouTube video player"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  allowFullScreen
/>
</div>

The 56.25% padding creates a 16:9 aspect ratio. Use 75% for 4:3.

Iframes

Any iframe content is automatically styled with:

  • Rounded corners on both the frame and content
  • Subtle border that adapts to light/dark mode
  • Consistent spacing above and below

Embedding External Content

<iframe
  src="https://example.com/embed"
  width="100%"
  height="400"
  title="Description of embedded content"
/>

Common Embeds

<iframe
  height="400"
  style={{width: '100%'}}
  src="https://codepen.io/USERNAME/embed/PEN_ID?default-tab=result"
  title="CodePen Embed"
  allowFullScreen
/>
<iframe
  src="https://codesandbox.io/embed/SANDBOX_ID?fontsize=14&theme=dark"
  style={{width: '100%', height: '500px', border: 0, borderRadius: '4px', overflow: 'hidden'}}
  title="CodeSandbox"
  allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
/>
<iframe
  style={{border: '1px solid rgba(0, 0, 0, 0.1)'}}
  width="100%"
  height="450"
  src="https://www.figma.com/embed?embed_host=share&url=FIGMA_URL"
  allowFullScreen
/>
<iframe
  src="https://www.loom.com/embed/VIDEO_ID"
  width="100%"
  height="400"
  allowFullScreen
/>

Styling Details

All iframes receive automatic styling for a consistent look:

PropertyValueDescription
Border radius0.5remRounded corners on content
Frame width8pxVisual padding around content
Border1pxSubtle border in theme color
Spacing1rem + 9pxMargin above and below

The styling adapts to your theme's color scheme, using --color-bg-secondary for the frame and --color-border for the border line.

Image Best Practices

Alt text helps screen readers and appears when images fail to load. Describe what the image shows, not just "screenshot" or "image".

{/* Good */}
![API response showing user data in JSON format](/images/tabs-preview.png)

{/* Avoid */}
![Screenshot](/images/tabs-preview.png)

Large images slow down page loads. Aim for:

  • Screenshots: PNG, under 500KB
  • Photos: JPEG, under 200KB
  • Icons/diagrams: SVG when possible

Tools like Squoosh or TinyPNG can compress images without visible quality loss.

Keep screenshots at consistent widths (e.g., 1200px). Jamdesk scales images to fit the content width automatically.

Supported Image Formats

FormatBest ForNotes
PNGScreenshots, UILossless, supports transparency
JPEGPhotosSmaller files, no transparency
SVGIcons, diagramsScales perfectly, tiny file size
GIFSimple animationsUse sparingly, can be large
WebPModern alternativeSmaller than PNG/JPEG

File Organization

Keep your media organized:

your-docs/
├── images/
│   ├── getting-started/
│   │   ├── step-1.png
│   │   └── step-2.png
│   ├── api/
│   │   └── response.png
│   └── logo.svg
└── docs.json

Reference them with the full path:

![Step 1](/images/help-center/dashboard/github-repository-access.webp)

What's Next?

SEO Optimization

Improve discovery and metadata

Frontmatter

Define titles, descriptions, and SEO fields