Components · Files
FilesPanel
The list of files shared in a place, one row per file with its type, name, size and time, which opens a preview and offers Jump to message and Download.
import { FilesPanel } from "@botiverse/raft-ui";The files panel lists the files shared in a place, such as #launch-week, newest first. Each row shows the file's type, its name, its size and when it was shared; clicking the row opens a preview, and two icon buttons jump to the message it came with and download it. It fills the Files section beside a conversation, or a full Files view.
When to use
In a Files section beside a conversation, list the files in the compact row the Tasks section uses (Rows in a compact list): the type icon, the name and its size, then the compact time (15:00 today, Oct 21 this year, 2025-10-21 before) and the actions at the right, all on one line at the side column's default 360px, with hairlines between rows instead of a card for each. Jump to message lands on the message with the located highlight (Located). FileRow is the card row of a full Files view and has no compact variant yet.
Where the files of a place sit on a screen (a side section or the channel details) is in Navigation and Page structure.
Anatomy
FilesPanel: asectiononlayer-canvasthat fills its column. Required.FilesViewport: the scroll container. Required.FilesList: the column of rows, 8px apart.FileRow: one file, onlayer-cardwith aline-hairlineoutline andradius-container.FileRowOpen: the button that covers the type, name and details and opens the preview.FileThumbnail: a 36px box for the file's FilePreview, or a thumbnail throughFileImage.FileContent:FileName, thenFileMetawith oneFileMetaItemper detail (size, time), intext-mono-metaandforeground-hint.
FileActions: the row'sFileActionicon buttons, ghost by default.
Variants
The file's type changes only its icon: a document, code, an archive or other file, or a thumbnail of an image or video (FilePreview).
States
How empty, loading and failed differ is in Feedback.
- Empty: an EmptyState in the viewport, with a paperclip icon, No files yet, and where files come from.
- Loading: a skeleton of rows, the same size as the rows that replace it.
- Failed: the error at the panel's scope, with Retry, not an empty state.
- More to load: the next page loads as people near the end of the list. A Load more button below the last row covers the case where scrolling can't trigger it.
- Menu open: while a menu opened from one of its
FileActions is up, the row laysfill-subtleover itself, the same subtle tier as its hover, so the file the menu acts on stays marked (Hover and press). - Not available: disable a
FileActionorFileRowOpenwhose action isn't available.
Content
- Show the file name as it was uploaded, with its extension. A long name is cut off at the end of the row.
- Give the size with its unit (184 KB) and the time as people read it elsewhere (Yesterday, 4:18 PM).
Accessibility
FilesPanel adds no Base UI primitive; its parts are a section, buttons and an image.
- Name
FilesPanelwitharia-label: Files. - Give every
FileActionanaria-labeland a tooltip that say what it does: Jump to original message, Download file. FileRowOpenis named by the file name inside it. The type drawing is decorative (FilePreview).- Give a thumbnail in
FileImagean emptyalt: the name beside it already says what the file is.
Rules
- Make the whole row the target for the preview, and keep the actions outside
FileRowOpenso each is its own button. - Keep
FileActionat its default, a ghost 32px icon button, so the row stays quiet (Button). - Don't color a row by its file type (FilePreview).
API
FilesPanel
Also takes the attributes of its element.
FilesViewport
Also takes the attributes of its element.
FilesList, FileRow, FileRowOpen, FileThumbnail
Also takes the attributes of its element.
FileImage
Also takes the attributes of its element.
FileContent, FileName, FileMeta, FileMetaItem, FileActions
Also takes the attributes of its element.
FileAction
Also takes the attributes of its element.
Related
Changes
- 0.73.0 · ChangedEvery region that scrolls is a ScrollArea:
PanelScrollViewport,ActivityInboxViewport,SearchShellViewport,NotificationCenterScroller,FilesViewport,TasksPanelViewport, ChoiceList's scroller,MobileNavServerPopoverList,ComposerSuggestionList,AnnouncementDialogBody,MessageActionCardScopeListViewportandDialogNavshow ScrollArea's overlay scrollbar instead of the platform's. Native scrolling stays only in the places scroll-area.md lists, each with its reason, and a test fails on any other. - 0.9.5 · FixedOn a touch screen, a tap no longer leaves a hover highlight on:
TableBodyrows, anInboxItem's pressed toggle action, the Activity inbox sort button and aFileRow(when itsFileRowOpenis hovered) now only show their hover on devices that can hover. With a mouse they look and behave as before.