> This page is for Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For task-scoped instructions for coding agents working in a Fern project, see https://buildwithfern.com/learn/home/fern-instructions.md.

# Download

> The Download component enables users to download PDFs, files, and multi-file ZIP bundles from your documentation.

The `<Download>` component lets users download assets like PDFs directly from your documentation. You can use it for single files or bundle multiple files into a ZIP download.

> **Info**
>
> For information on how to embed images, PDFs, and other assets, check out the documentation on [Rich media in Markdown](/learn/docs/writing-content/markdown-media).

## Usage

### Single file

Download PDF

**`Markdown`**

```jsx Markdown
<Download src="./assets/all-about-ferns.pdf">Download PDF</Download>
```

### File in a button

Wrap a `<Button>` to style the download trigger.

Download PDF

**`Markdown`**

```jsx Markdown
<Download src="./assets/all-about-ferns.pdf">
  <Button intent="primary">Download PDF</Button>
</Download>
```

### Multiple files as ZIP

Use the `sources` prop to bundle multiple files into a single ZIP download. The component fetches each file client-side and packages them into a ZIP archive using [fflate](https://github.com/101arrowz/fflate).

This is useful when you want users to download a collection of related assets — such as brand logos, SDK files, or configuration templates — without needing to host a pre-built ZIP file.

**`Markdown`**

```jsx Markdown
<Download
  sources={[
    "https://example.com/assets/logo-dark.svg",
    "https://example.com/assets/logo-light.svg",
    "https://example.com/assets/icon.svg"
  ]}
  filename="brand-assets.zip"
>
  <Button intent="primary">Download brand assets</Button>
</Download>
```

## Properties

**`src`** `string`

Path to a single file for download (relative to the current MDX file). The asset must be located within the `fern` folder. Use `src` for **single-file downloads**. Mutually exclusive with `sources` — you must provide one or the other.

---

**`sources`** `string[]`

An array of publicly accessible URLs to bundle into a ZIP download. Use `sources` for **multi-file downloads** — the component fetches each URL client-side and packages them into a ZIP archive. Mutually exclusive with `src`. If only one URL is provided, it behaves like `src` (downloads the file directly without zipping). The filename for each file inside the ZIP is derived from the last segment of its URL (e.g., `logo-dark.svg`). If any file fails to fetch, the entire download will fail.

---

**`children`** `React.ReactNode` — required

The text or element to display as the click target for the download. Can be plain text (e.g. `Download PDF`) or a React element such as a `<Button>`. Don't wrap the text in a Markdown link (e.g. `[Download PDF](./file.pdf)`) — `<Download>` handles the link behavior itself, so a Markdown link is both incorrect and unnecessary.

---

**`filename`** `string`

The filename for the downloaded file. When used with `sources`, this sets the name of the ZIP file (defaults to `download.zip`). When used with `src`, it overrides the original asset filename.

---