ComponentsData display

Download kit

A list of files to download (press kit, brand assets, templates, datasets) with format and size. Each row downloads on its own; ticked rows download together as one ZIP built in the browser with no dependency. Files can be hosted (href) or generated on demand (data), and a file that fails to fetch is listed in a note inside the archive instead of breaking it.

components/download-kit.tsx, components/_zip.tstheme · material · accent · density · font
  • Logo, light background

    logo-light.svgSVG · 190 byte

  • Logo, dark background

    logo-dark.svgSVG · 190 byte

  • Fact sheet

    fact-sheet.txtTXT · 160 byte

    Founding year, team size, contact
  • Brand colours

    colours.jsonJSON · 80 byte

Installation

$ pnpm add @vamos-ui/react

The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";

Usage

import { DownloadKit } from "@vamos-ui/react";

<DownloadKit archiveName="press-kit" assets={[
  { id: "logo", name: "Logo, light background", file: "logo.svg", href: "/press/logo.svg", format: "SVG", size: 4_200 },
  { id: "facts", name: "Fact sheet", file: "facts.txt", data: () => factSheetText, format: "TXT" },
]} />

The ZIP fetches hosted files, so they must be same-origin or allow CORS; the single download of a hosted file is a plain link and has no such limit.

Progress and results go to a polite status line. Select all is tri-state and every row checkbox is named after its file.

Stored ZIPs are not compressed: fine for images, PDFs and archives; compress large text datasets on the server.

Examples

API

DownloadKit

PropTypeDefault
assets
{ id, name, file, size? (bytes), format?, description?, preview?, icon?, href?, data? }. data (string, bytes, Blob or a promise) wins over href.
DownloadAsset[]—
selectable
Checkboxes, select all and the ZIP button.
booleantrue
selected / defaultSelected / onSelectedChange
Selected ids (default: all).
string[]—
archiveName
ZIP name without .zip, also the folder inside it.
string"downloads"
onDownload
After a file or the archive is saved (analytics).
({ ids, file, size, kind }) => void—
labels
Dictionary namespace "downloadKit".
Partial<DownloadKitLabels>—

createZip(entries, date?)

PropTypeDefault
returns
A stored (uncompressed) ZIP with UTF-8 names from { name, data: Uint8Array }[].
Blob—