Dev Tools
DownloadButton
Compact clickable card for downloading files. Shows a green icon box, filename with extension, and upload date. Auto-width — sits inline in content.
Import
import DownloadButton from '../../components/utility/DownloadButton.astro'; Props
| Prop | Type | Required | Description |
|---|---|---|---|
href | string | Yes | Download URL. Rendered with the download attribute so the browser downloads the file. |
filename | string | Yes | Displayed filename including extension (e.g. TT Satoshi.zip). Should mirror the real file name. |
date | string | Yes | Upload date, pre-formatted (e.g. 13 Apr 2026). |
Anatomy
- Root:
<a>withdownloadattribute — triggers browser download - Card padding:
4pxaround the icon box,16pxon the text side - Icon box:
64 × 64, radius12px, fill--color-fill-element-brand-soft - Download icon:
24px, color--color-content-brand - Text block: filename (
body-md-strong, primary) + date (body-sm, tertiary) - Card uses the surface-action token family (same pattern as Thumbnail) for fill / border / shadow
Usage
<DownloadButton
href="/fonts/TT_Satoshi.zip"
filename="TT Satoshi.zip"
date="13 Apr 2026"
/> Live examples
Archive (.zip)
Font source (.otf)
Long filename
Multiple in a row — auto-width, each sizes to its content
Notes
- Auto-width — the button sizes to fit its content and does not stretch in grid layouts.
- Colors, border and shadow use semantic tokens on both rest and hover states (surface-action family + brand-soft for the icon box).
- The
dateprop is a plain string — format the date in the page code, not inside the component. - For inline groups, wrap multiple buttons in a flex container with your own gap.