Attachments
Attach files to records and comments with clear ownership, visibility and deletion rules that match the record they belong to.
6 states5 edge casesDesktop + Mobile
01The problem
Files rarely live alone: a receipt belongs to an expense, a contract to a deal, a screenshot to a comment. Users need to know who can see an attachment, what happens when the record or comment is deleted, and which file is the current one when several versions have been added.
02When to use
Use when
- Files that belong to a record: invoice PDFs, contracts, receipts
- Files shared in comments and discussions
- Records that need supporting evidence for review or audit
Avoid when
- Files that exist independently of any record — use a file library.
- Files users edit together — link to a document instead.
03Recommended UX
Statecraft recommendation
Attachments inherit the visibility of the thing they're attached to, and the UI says so at the point of upload.
04Desktop behaviour
On desktop the attachments list sits in the record's side column or a dedicated section, with previews a click away.
Desktop rules
- Each row: type icon, name, size, uploaded by, date, overflow menu.
- State the visibility next to the upload control.
- Comments show attachments inline as compact chips that open the preview.
- Show “Replace” for files that should have one current version (e.g. signed contract).
05Mobile behaviour
On mobile, attachments are usually viewed rather than managed. Keep the list compact and the add action within reach.
Mobile rules
3 mobile rules are included in Pro.
Statecraft Pro
Unlock the full pattern
Get the complete interaction flow, states, edge cases, mobile rules and implementation prompt.
- Interaction flow · 5 steps
- 3 mobile rules
- 6 states
- 5 edge cases with recommendations
- 4 microcopy comparisons
- Accessibility notes
- Developer notes
- Claude Code / Codex implementation prompt
Edge cases covered in this pattern
- Record deleted
- Comment edited to remove a file
- Visibility changes
- Same file attached twice
- Uploader leaves the company