+++
date = 2021-05-15T15:00:00Z
description = "A brief description of custom Components for Zola that implement modern html elements: video, image, gif, audio."
draft = false
title = "Rich Content"
[extra]
keywords = "Images, Videos, Audio, Gif, Rich Content, Components"
series = "Features"
toc = true
[taxonomies]
tags = [
"Features",
"Video",
"Audio",
"Images",
"Components",
]
+++
Several custom components are included to augment CommonMark. `video`, `image`, `gif`, and `audio` were created to help you take advantage of modern HTML elements in your writing.
## Video
- `sources` is an array of video file paths. (mandatory)
- `class` sets a class for the video.
- `caption` sets the caption text below the video.
- `w` sets the width of the video.
- `h` sets the height of the video.
- `autoplay` when set, autoplays the video on load.
- `loop` when set, plays the video on a loop.
- `muted` when set, sets the audio muted initially.
- `playsinline` when set, plays the video embeded instead of fullscreen on mobile browsers.
*sources can be same path, relative path, or root path, like the [img component](https://abridge.pages.dev/overview-images/#img-component)*
**Optional Classes:**
- `ci` can be used to center the image.
- `fr` can be used to float the image right.
- `fl` can be used to float the image left.
- `b1` can be used to add a 1px border.
### Usage
{% raw %}
```rs
{{}}
```
{% endraw %}
### Output
```html
{{}}
```
{{}}
### Usage
{% raw %}
```rs
{{}}
```
{% endraw %}
### Output
```html
{{}}
```
{{}}
## Image
The `image` component returns a `` tag with multiple sources.
Each string in the `sources` array should be a path to an image file of a different type (`avif`, `webp`, `png`, `jpg`, etc).
The last image in the `sources` array is used to create an `` tag for the browser to fall back on if the other formats are not yet supported.
- `sources` is an array of image file paths. (mandatory)
- `class` sets a class for the image.
- `caption` sets the caption text below the image.
- `w` sets the width of the image.
- `h` sets the height of the image.
*sources can be same path, relative path, or root path, like the [img component](https://abridge.pages.dev/overview-images/#img-component)*
**Optional Classes:**
- `ci` can be used to center the image.
- `fr` can be used to float the image right.
- `fl` can be used to float the image left.
- `b1` can be used to add a 1px border.
### Usage
{% raw %}
```rs
{{}}
```
{% endraw %}
### Output
```html
{{}}
```
{{}}
## GIF
The `gif` component is exactly the same as the [video component](#video).
The only difference is it automatically has the additional properties: `autoplay`, `loop`, `muted`, `playsinline`.
Using the `