Skip to content

Commit 040ea54

Browse files
Update markdown.mdx based on issue #239
1 parent 681ec75 commit 040ea54

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Images
2+
3+
Images in Fern documentation can be added using standard Markdown syntax or HTML tags.
4+
5+
## Basic Image Syntax
6+
7+
### Markdown
8+
```md
9+
![Alt text](./path/to/image.png)
10+
```
11+
12+
### HTML
13+
```html
14+
<img src="./path/to/image.png" alt="Alt text" />
15+
```
16+
17+
## Image Options
18+
19+
### Preventing Zoom
20+
To prevent an image from being zoomable, add the `noZoom` attribute:
21+
22+
```html
23+
<img src="./path/to/image.png" alt="Alt text" noZoom />
24+
```
25+
26+
### Classes and Styling
27+
Add CSS classes using the `className` attribute:
28+
29+
```html
30+
<img
31+
src="./path/to/image.png"
32+
alt="Alt text"
33+
className="custom-class"
34+
/>
35+
```
36+
37+
## Best Practices
38+
39+
- Always include descriptive alt text for accessibility
40+
- Use relative paths starting with `./` or `../`
41+
- Optimize images for web before adding to docs
42+
- Consider if zoom functionality is needed for each image
43+
- Keep image file sizes reasonable for fast loading
44+
45+
## Examples
46+
47+
A zoomable image (default behavior):
48+
```html
49+
<img src="./examples/chart.png" alt="Data visualization chart" />
50+
```
51+
52+
A non-zoomable image:
53+
```html
54+
<img src="./examples/icon.svg" alt="Navigation icon" noZoom />
55+
```
56+
57+
A styled image with multiple attributes:
58+
```html
59+
<img
60+
src="./examples/diagram.png"
61+
alt="Architecture diagram"
62+
className="border rounded-lg"
63+
noZoom
64+
/>
65+
```

0 commit comments

Comments
 (0)