Skip to content

Commit 922620b

Browse files
authored
Update images and embeds (#863)
* update page * add info on styling with CSS * move styling info to Custom scripts
1 parent 0cde3a9 commit 922620b

File tree

2 files changed

+115
-64
lines changed

2 files changed

+115
-64
lines changed

image-embeds.mdx

Lines changed: 96 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,113 @@
11
---
2-
title: 'Images and embeds'
3-
description: 'Add image, video, and other HTML elements'
4-
icon: 'image'
2+
title: "Images and embeds"
3+
description: "Add images, videos, and iframes"
4+
icon: "image"
55
---
66

7+
<Frame>
78
<img
89
className="rounded-xl"
910
src="https://mintlify-assets.b-cdn.net/bigbend.jpg"
11+
alt="Photograph of a scenic landscape with purple flowers in the foreground, mountains in the background, and a blue sky with scattered clouds."
1012
/>
13+
</Frame>
1114

12-
## Image
15+
## Images
1316

14-
Images are the most common way to add visual content to your documentation.
17+
Add images to provide visual context, examples, or decoration to your documentation.
1518

16-
### Basics
19+
### Basic image syntax
1720

18-
The [markdown syntax](https://www.markdownguide.org/basic-syntax/#images) lets you add images using the following code
21+
Use [Markdown syntax](https://www.markdownguide.org/basic-syntax/#images) to add images to your documentation:
1922

2023
```mdx
21-
![title](/path/image.jpg)
24+
![Alt text describing the image](/path/to/image.png)
2225
```
26+
2327
<Tip>
24-
To make sure images are displayed correctly in production, add a forward slash to the image path (e.g. `/path/image.jpg`).
28+
Always include descriptive alt text to improve accessibility and SEO. The alt text should clearly describe what the image shows.
2529
</Tip>
2630

27-
Note that the image file size must be less than 20MB. Otherwise, we recommend hosting on a CDN provider like [S3](https://aws.amazon.com/s3), [Cloudinary](https://cloudinary.com) or a similar service.
31+
Image files must be less than 20MB. For larger files, host them on a CDN service like [Amazon S3](https://aws.amazon.com/s3) or [Cloudinary](https://cloudinary.com).
2832

29-
### Embeds
33+
### HTML image embeds
3034

31-
To get more customizability with images, you can also use embeds to add images.
35+
For more control over image display, use HTML `<img>` tags:
3236

3337
```html
34-
<img height="200" src="/path/image.jpg" />
38+
<img
39+
src="/images/dashboard.png"
40+
alt="Main dashboard interface"
41+
height="300"
42+
className="rounded-lg"
43+
/>
3544
```
3645

37-
### Disable Image Zoom
46+
#### Disable zoom functionality
3847

39-
To disable the default zoom on click for images, add the `noZoom` property to image embeds.
48+
To disable the default zoom on click for images, add the `noZoom` property:
4049

41-
```html
42-
<img height="200" noZoom src="/path/image.jpg" />
50+
```html highlight="4"
51+
<img
52+
src="/images/screenshot.png"
53+
alt="Descriptive alt text"
54+
noZoom
55+
height="200"
56+
/>
4357
```
4458

45-
### Linking Images
59+
#### Link images
4660

47-
To link an image, for example to create a button on your docs, encompass the image in a link with the `noZoom` property. Images in `a` tags will automatically have a pointer cursor.
61+
To make an image a clickable link, wrap the image in an anchor tag and add the `noZoom` property:
4862

4963
```html
5064
<a href="https://mintlify.com" target="_blank">
51-
<img height="200" noZoom src="/path/image.jpg" />
65+
<img
66+
src="/images/logo.png"
67+
alt="Mintlify logo"
68+
noZoom
69+
height="100"
70+
/>
5271
</a>
5372
```
5473

55-
### Dark Mode
74+
<Note>
75+
Images within anchor tags automatically display a pointer cursor to indicate they are clickable.
76+
</Note>
77+
78+
#### Light and dark mode images
5679

57-
To use separate images for light and dark mode, use Tailwind CSS to hide and show images.
80+
To display different images for light and dark themes, use Tailwind CSS classes:
5881

5982
```html
60-
<img className="block dark:hidden" src="/path/image-light.jpg" />
61-
<img className="hidden dark:block" src="/path/image-dark.jpg" />
83+
<!-- Light mode image -->
84+
<img
85+
className="block dark:hidden"
86+
src="/images/light-mode.png"
87+
alt="Light mode interface"
88+
/>
89+
90+
<!-- Dark mode image -->
91+
<img
92+
className="hidden dark:block"
93+
src="/images/dark-mode.png"
94+
alt="Dark mode interface"
95+
/>
6296
```
6397

64-
### Related
98+
## Videos
99+
100+
Mintlify supports [HTML tags in Markdown](https://www.markdownguide.org/basic-syntax/#html), giving you flexibility to create rich content.
65101

66-
For more information, we recommend the following sections:
102+
<Tip>
103+
Always include fallback text content within video elements for browsers that don't support video playback.
104+
</Tip>
67105

68-
<Card
69-
title="Frame Component Reference"
70-
icon="frame"
71-
href="/components/frames"
72-
>
73-
Read the reference for the Frame component
74-
</Card>
106+
### YouTube embeds
75107

76-
## Videos
108+
Embed YouTube videos using iframe elements:
77109

110+
```html
78111
<iframe
79112
className="w-full aspect-video rounded-xl"
80113
src="https://www.youtube.com/embed/4KzFe50RQkQ"
@@ -83,62 +116,64 @@ For more information, we recommend the following sections:
83116
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
84117
allowFullScreen
85118
></iframe>
119+
```
86120

87-
<br />
88-
89-
<Tip>
90-
91-
Mintlify supports [HTML tags in Markdown](https://www.markdownguide.org/basic-syntax/#html). This is helpful if you prefer HTML tags to Markdown syntax, and lets you create documentation with infinite flexibility.
92-
93-
</Tip>
94-
95-
For YouTube videos use:
96-
97-
```html
121+
<Frame>
98122
<iframe
99-
width="560"
100-
height="315"
123+
className="w-full aspect-video rounded-xl"
101124
src="https://www.youtube.com/embed/4KzFe50RQkQ"
102125
title="YouTube video player"
103-
frameborder="0"
126+
frameBorder="0"
104127
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
105128
allowFullScreen
106129
></iframe>
107-
```
130+
</Frame>
108131

109-
For other videos, use:
132+
### Self-hosted videos
133+
134+
Use the HTML `<video>` element for self-hosted video content:
110135

111136
```html
112137
<video
113138
controls
114-
className="w-full aspect-video"
139+
className="w-full aspect-video rounded-xl"
115140
src="link-to-your-video.com"
116141
></video>
117142
```
118143

119-
To autoplay the video, use:
144+
### Autoplay videos
145+
146+
To autoplay a video, use:
120147

121148
```html
122149
<video
123150
autoPlay
124151
muted
125152
loop
126153
playsInline
127-
className="w-full aspect-video"
128-
src="link-to-your-video.com"
154+
className="w-full aspect-video rounded-xl"
155+
src="/videos/demo.mp4"
129156
></video>
130157
```
131158

132-
<Warning>
133-
Since Mintlify needs to adhere to the JSX syntax, double word attributes will need to
134-
be written in camelCase such as `autoPlay` and `playsInline`.
135-
</Warning>
159+
<Note>
160+
When using JSX syntax, write double-word attributes in camelCase: `autoPlay`, `playsInline`, `allowFullScreen`.
161+
</Note>
136162

137-
## iFrames
163+
## iframes
138164

139-
Loads another HTML page within the document.
165+
Embed external content using iframe elements:
140166

141167
```html
142-
<iframe src="https://www.youtube.com/embed/4KzFe50RQkQ"> </iframe>
168+
<iframe
169+
src="https://example.com/embed"
170+
title="Embedded content"
171+
className="w-full h-96 rounded-xl"
172+
></iframe>
143173
```
144174

175+
## Related resources
176+
177+
<Card title="Frame component reference" icon="frame" horizontal href="/components/frames">
178+
Learn how to use the Frame component for presenting images.
179+
</Card>

settings/custom-scripts.mdx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
---
2-
title: 'Custom scripts'
3-
description: 'Fully customize your documentation with custom CSS and JS'
2+
title: "Custom scripts"
3+
description: "Fully customize your documentation with custom CSS and JS"
44
icon: "code"
55
---
66

7-
Add custom CSS and JavaScript to your documentation to fully customize the look and feel.
7+
Use CSS to style HTML elements or add custom CSS and JavaScript to fully customize the look and feel of your documentation.
8+
9+
## Styling with Tailwind CSS
10+
11+
Use Tailwind CSS v3 to style HTML elements. You can control layout, spacing, colors, and other visual properties. Some common classes are:
12+
13+
- `w-full` - Full width
14+
- `aspect-video` - 16:9 aspect ratio
15+
- `rounded-xl` - Large rounded corners
16+
- `block`, `hidden` - Display control
17+
- `dark:hidden`, `dark:block` - Dark mode visibility
18+
19+
Tailwind CSS arbitrary values are not supported. For custom values, use the `style` prop instead.
20+
21+
```html
22+
<img style={{ width: '350px', margin: '12px auto' }} src="/path/image.jpg" />
23+
```
824

925
## Custom CSS
1026

0 commit comments

Comments
 (0)