App components / AI chat
Attachment preview
Attachments opened up. Image preview shows an image full size with previous, next and thumbnails, plus Replace and Remove; File preview opens a document in a side panel on the cited page, with the passage marked and Ask about this page.
MembersReact · Vue · HTMLFigma: AI chat
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
roadmap-q4.png
PNG · 1.2 MB · 2 of 3
Design freeze
Beta
Pricing
Migration
Installation
Examples
File preview
Page through the file.
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
01Each image and each page fades in as you move between them.
02The file panel rises in with an ease-out; buttons sink when pressed.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| ImagePreview images / index / onIndexChange | { name, meta, src, alt, content }[], number | – | The images; ← and → move. |
| ImagePreview onReplace / onRemove / onClose | () => void | – | Header actions and the esc key. |
| FilePreview name / meta / page / pages / onPageChange | string, number | – | The file and the page shown. |
| FilePreview cited / footnote / onAsk / onOpen / onClose | boolean, ReactNode, () => void | – | Cited on this page, Cited in 2 answers, Ask about this page, open outside. |
| FilePreview children | ReactNode | – | The page; mark quotes with CitedPassage. |
Usage
Use it for
- Image preview from an image attachment in the composer or a message.
- File preview from a file attachment or a citation card's Open in preview.
Avoid
- Opening files in a new tab when people only need to check one passage.
- A corner X: both close with the esc key.