From ccd25c2ba1addd18518139cf62aa11d54eec2cf3 Mon Sep 17 00:00:00 2001 From: fern-support Date: Thu, 12 Mar 2026 13:34:46 +0000 Subject: [PATCH 1/2] Document multi-file ZIP download support for Download component Co-Authored-By: bot_apk --- .../docs/pages/changelog/2026-03-12.mdx | 21 ++++++++++++ .../default-components/download.mdx | 33 ++++++++++++++++--- 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 fern/products/docs/pages/changelog/2026-03-12.mdx diff --git a/fern/products/docs/pages/changelog/2026-03-12.mdx b/fern/products/docs/pages/changelog/2026-03-12.mdx new file mode 100644 index 000000000..d821db20b --- /dev/null +++ b/fern/products/docs/pages/changelog/2026-03-12.mdx @@ -0,0 +1,21 @@ +--- +tags: ["components"] +--- + +## Multi-file ZIP downloads + +The `` component supports bundling multiple files into a single ZIP download. Use the `sources` prop with an array of file URLs, and the component fetches each file and packages them into a ZIP archive client-side. + +```jsx Markdown + + + +``` + +Learn more about the [Download component](/learn/docs/component-library/download). diff --git a/fern/products/docs/pages/component-library/default-components/download.mdx b/fern/products/docs/pages/component-library/default-components/download.mdx index e2d5ec1b2..75bbcffd8 100644 --- a/fern/products/docs/pages/component-library/default-components/download.mdx +++ b/fern/products/docs/pages/component-library/default-components/download.mdx @@ -1,11 +1,11 @@ --- title: Download -description: The Download component enables users to download PDFs and files from your documentation. Simple setup with custom filenames. +description: The Download component enables users to download PDFs, files, and multi-file ZIP bundles from your documentation. --- -The `` component lets users download assets like PDFs directly from your documentation. +The `` 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. 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). @@ -13,6 +13,8 @@ For information on how to embed images, PDFs, and other assets, check out the do ## Usage +### Single file +
@@ -25,10 +27,31 @@ For information on how to embed images, PDFs, and other assets, check out the do ``` +### Multiple files as ZIP + +Use the `sources` prop to bundle multiple files into a single ZIP download. The component fetches each file and packages them client-side. + +```jsx Markdown + + + +``` + ## Properties - - Path to your local asset (relative to current MDX file). The asset must be located within the `fern` folder. + + Path to your local asset (relative to current MDX file). The asset must be located within the `fern` folder. Required when `sources` isn't provided. + + + + An array of file URLs to bundle into a ZIP download. When provided, the component fetches each file and packages them into a ZIP archive client-side. Required when `src` isn't provided. @@ -36,5 +59,5 @@ For information on how to embed images, PDFs, and other assets, check out the do - The filename to use for the downloaded asset. If not provided, the filename will be the same as the asset's name. + 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. From e5c33fa1f555612fc373fba4802a58479e9cbfd6 Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Thu, 12 Mar 2026 14:21:40 -0400 Subject: [PATCH 2/2] clarify some details --- .../docs/pages/changelog/2026-03-12.mdx | 15 ++++++---- .../default-components/download.mdx | 28 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/fern/products/docs/pages/changelog/2026-03-12.mdx b/fern/products/docs/pages/changelog/2026-03-12.mdx index d821db20b..c125b5c6d 100644 --- a/fern/products/docs/pages/changelog/2026-03-12.mdx +++ b/fern/products/docs/pages/changelog/2026-03-12.mdx @@ -4,18 +4,21 @@ tags: ["components"] ## Multi-file ZIP downloads -The `` component supports bundling multiple files into a single ZIP download. Use the `sources` prop with an array of file URLs, and the component fetches each file and packages them into a ZIP archive client-side. +The `` component now supports bundling multiple files into a single ZIP download using the new `sources` prop. 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. + +Pass an array of publicly accessible URLs to `sources`, and the component fetches each file client-side and packages them into a ZIP archive: ```jsx Markdown - + ``` -Learn more about the [Download component](/learn/docs/component-library/download). + diff --git a/fern/products/docs/pages/component-library/default-components/download.mdx b/fern/products/docs/pages/component-library/default-components/download.mdx index 75bbcffd8..d44394d16 100644 --- a/fern/products/docs/pages/component-library/default-components/download.mdx +++ b/fern/products/docs/pages/component-library/default-components/download.mdx @@ -16,9 +16,11 @@ For information on how to embed images, PDFs, and other assets, check out the do ### Single file
- - - +
+ + + +
```jsx Markdown @@ -29,33 +31,35 @@ For information on how to embed images, PDFs, and other assets, check out the do ### Multiple files as ZIP -Use the `sources` prop to bundle multiple files into a single ZIP download. The component fetches each file and packages them client-side. +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. ```jsx Markdown - + ``` ## Properties - Path to your local asset (relative to current MDX file). The asset must be located within the `fern` folder. Required when `sources` isn't provided. + 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. - An array of file URLs to bundle into a ZIP download. When provided, the component fetches each file and packages them into a ZIP archive client-side. Required when `src` isn't provided. + 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. - The text or element to display as the click target for the download. + The text or element to display as the click target for the download. Typically a `