Attachments
Container component for a list of downloadable files with per-file metadata (name, extension, size, description, date, icon, page count, thumbnail). Used on publication pages, document libraries, and any content page with attached files. The name is plural because the component is the container - a single attachment on a page still uses this component with a files array of length 1.
Usage
When to use
- Publication or report pages that expose one or more downloadable documents
- Document libraries where users browse and download files
- Content pages with supporting downloads at the bottom of the body
When not to use
- For content item listings (articles, news, events) - use
collectioninstead - For a single inline file link within a paragraph - use a normal link
- For uploads / submissions - use the upload form component
Do
- Include extension, size and (for PDFs) page count so users know what they are downloading
- Provide meaningful descriptions for documents whose titles alone are ambiguous
- Use the thumbnail type on document-heavy pages where visual previews aid scanning
Don't
- Use icon-only file type indicators - always show the extension as text
- Hide file size or type from the link text
- Mix unrelated file groups in a single attachments list - split them into separate sections with their own titles
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
files | array | - | Array of {name, url, extension, size, date, date_iso, pages, description, icon, thumbnail} file objects. thumbnail is {url, alt} for type=thumbnail display. |
title | string | - | Optional section heading above the list. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.thumbnail | Type | - | Editorial type that attaches a preview image to each file instead of a file-type icon. |
Examples
Thumbnails
Thumbnail preview variant for document-heavy pages.
Single
Single-file attachment (array length 1) showing the adapted styling.
Multiple
Four files in one list, each row carrying its own type icon, extension and size.
Accessibility
- WCAG 2.2 AA
- Each file link announces full context - name, file type, size, and page count where applicable - so screen reader users know what they are about to download.
- Extension indicator must be real text, not an icon or background image.
- Download icon is decorative and ignored by assistive tech.
- Thumbnail images must have meaningful alt text when they convey content, or empty alt when purely decorative.
- Focus-visible outline must cover the entire clickable row, not just the file name.
- Meta row (extension, size, date) must meet AA contrast even at its smaller visual size.
Dependencies
- icon - provides the file-type icon sprite
Related
- icon - file-type icon sprite
- collection - content item listing (different concept, not file downloads)
- content - attachments often appear at the bottom of a content page, below the main body