File Embed
ProNewShare supplied files as a list, boxed rows, preview-card grid or inline viewer, with type icons, sizes, download links and a popup for PDFs and images.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| files* | EmbedFile[] | — |
| layout | "viewer" | "list" | "grid"`viewer` shows one file inline, `list` and `grid` show them all. | "list" |
| title | stringOptional heading above the files. | — |
| rows | "plain" | "boxed"Row style of the list layout. | "plain" |
| columns | 2 | 3 | 4Most columns the grid may use; it drops columns as the container narrows. | 3 |
| action | "preview" | "link" | "download"What choosing a file does: open the preview popup, open the link, or download. | "preview" |
| icons | booleanShow the type icon. | true |
| sizes | booleanShow the file size. | true |
| download | booleanShow a download control on every file. | true |
| downloadLabel | stringText of the download control in grid and boxed rows. | "Download" |
| viewerHeight | numberHeight of the inline viewer, in pixels. | 560 |
| loading | booleanShows placeholders while the file list is being fetched. | false |
| emptyText | stringShown when there are no files. | "No files have been shared yet." |
| onOpen | (file: EmbedFile) => void | — |
| onDownload | (file: EmbedFile) => void | — |
| className | string | — |
Accessibility
- Files with safe links remain real, named links; invalid links are omitted and their count announced instead of creating unsafe actions.
- The preview popup is a dialog that traps focus, closes with Escape and returns focus to the file you chose; panel and backdrop enter together.
- In the viewer layout files are tabs: Left, Right, Home and End move between them.
- Type icons are decorative; the type is also written in the line under the name.
- Loading is announced as a status, and files with no preview say so and offer the download.