DocumentCard
Document row with file metadata, access status and an optional download action.
Design intent
Deal rooms repeat the same document row. DocumentCard keeps the file type, size, updated date, access state and download action in one consistent row.
npx @slipstream-ui/cli@latest add document-cardQ3-report.pdf
PDF · 2.4 MB · Nov 1, 2026
contract-draft.pdf
PDF · 8.1 MB
Contact-list.xlsx
XLSX · 640 KB
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | required | File name. |
| fileType | string | required | Short file type label, such as PDF or XLSX. |
| size | string | — | Human-readable file size. |
| updatedAt | string | — | Updated date or relative time. |
| status | 'available' | 'restricted' | 'pending' | 'available' | Access state. |
| onDownload | () => void | — | Download handler; omit for a display-only row. |
| downloadLabel | string | 'Download' | Download button label. |
| icon | ReactNode | — | Custom file icon slot. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't enable download for restricted files
The button is disabled unless status is available; access is never implied.
tsx<DocumentCard status="restricted" onDownload={download} />
Accessibility
- The download button is named Download <file name>.
- Status is a text badge; restricted downloads are disabled.
Composition
Compose with Card: DocumentCard is a compact Card row
<DocumentCard name="." fileType="PDF" />
Related components: Card, Badge, Button, FileUpload
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.