Open a file without leaving the conversation
A dialog on a wide screen and a full-screen sheet on a narrow one. The header names the file, its size and its place in the set. The viewer shows pictures itself and lets the host draw anything else. When there is nothing to show, it says so plainly.
Pictures
Several pictures share one viewer. The footer steps through them, the arrow keys do the same, and the header says where you are.
Drawn by the host
The viewer carries no document renderer. Pass a function and the host draws what the viewer cannot, such as the pages of a PDF.
Nothing to show
A format with no preview says so beside its mark, name and size, and offers the download.
A file that would not load
When a file fails or its link has expired, the viewer explains and offers another try.
// From the npm package
import { AttachmentViewer } from 'rift-ds/components/AttachmentViewer/AttachmentViewer';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/attachment-viewer.json