Embedded Assets and Files
Fern enables using the native HTML5 tags to embed local assets like PDFs, videos, and more in your documentation. Supported tags include:
<embed src="..." />
- Embed External Content<source src="..." />
- Media or Image Source
Fern also implements a custom component for embedding downloadable assets:
<Download src="..." />
- read more about it below.
Properties
Path to your local asset (relative to current MDX file)
MIME type of the asset (e.g. ‘video/mp4’, ‘application/pdf’)
Examples
Video File
Example using `<embed>`
Example using `<video>`
Videos with audio will automatically play when the page loads. If you want to prevent this behavior, consider using the <video>
component instead, which provides more control over playback.
PDF Document
Common MIME Types
The supported file types and behavior may vary depending on the browser and the type of content being embedded. For video files, consider using MP4 format for maximum compatibility.
Downloadable Assets
0.54.0-rc1
.Enable users to download assets from within your documentation, instead of linking to them, by using the <Download>
component.
Path to your local asset (relative to current MDX file)
The text or element to display as the click target for the download.
The filename to use for the downloaded asset. If not provided, the filename will be the same as the asset’s name.