One file in a list
File row shows a file the way a document list needs it: the same type mark the attachment tile and viewer draw, its name, a line of detail and controls at the end. The name opens the file, as a link to it or a button that shows it in place, so a keyboard can walk a folder row by row.
A folder
Alternatives
- Use Attachment tile instead when the file sits on a chat message or in a composer, shown as a square.
Props
Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
name* | string | The file's name with its extension (`Q3 report.pdf`), which also picks its type mark. | |
mimeType | string | The file's MIME type, when its name has no telling extension. | |
kind | FileKind | picked from the name and the MIME type | The file's kind, when neither its name nor its MIME type says it. |
typeLabel | string | The type mark's lettering, in place of the one derived from the name. | |
meta | ReactNode | A quiet second line: the size, who added it, when. | |
href | string | Makes the name a link to the file or its preview page. | |
onOpen | (() => void) | Makes the name a button that opens the file in place, such as in a DocumentViewer dialog. `href` wins when both are set. | |
actions | ReactNode | Controls at the row's end: a download, a share, a menu. | |
size | "default" | "compact" | 'default' | Row density: `compact` for a list in a side panel. |
linkComponent | LinkComponent | The component the name's link renders with, such as Next.js's `Link`, so
it navigates through the app's router; a plain `<a>` when unset. This
component can render on the server, so it never reads a LinkProvider:
pass the prop even under one. | |
className | string | '' | Additional CSS classes |
Keys
The name is a native link or button and the actions passed in are native controls, reached with Tab. Those keys belong to the platform, so no test of this library presses them.
// From the npm package
import { FileRow } from 'rift-ds/components/FileRow/FileRow';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/file-row.json1.8 kB gzipped, with everything it imports. Peer dependencies are not counted.
For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.