FilesPanel
Composable panel structure for channel files, thumbnails, metadata, and file actions.
import {
FileAction,
FileActions,
FileContent,
FileImage,
FileMeta,
FileMetaItem,
FileName,
FilePreview,
FilePreviewBadge,
FilePreviewMedia,
FileRow,
FileRowOpen,
FilesList,
FilesPanel,
FilesViewport,
FileThumbnail,
} from "raft-ui";
<FilesPanel aria-label="Files panel">
<FilesViewport>
<FilesList>
<FileRow>
<FileRowOpen>
<FileThumbnail>
<FilePreview>
<FilePreviewMedia>
<FileImage src="/file.png" alt="" />
</FilePreviewMedia>
<FilePreviewBadge />
</FilePreview>
</FileThumbnail>
<FileContent>
<FileName />
<FileMeta>
<FileMetaItem />
</FileMeta>
</FileContent>
</FileRowOpen>
<FileActions>
<FileAction />
</FileActions>
</FileRow>
</FilesList>
</FilesViewport>
</FilesPanel>Loading
Error
Empty
The package exposes structure and native event surfaces. The consumer decides how to preview, download, jump to the original message, fetch the next cursor, and render loading or error states. This advanced example keeps those actions observable without introducing product stores or routing into raft-ui.
Ready
API#WIP
FilesPanel
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"section"> | — | Files tab panel root. It owns the themed surface; fetching, routing, and file policy remain in the consumer. |
FilesViewport
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Scrollable panel viewport. Attach near-end or other pagination behavior through native scroll props. |
FilesList
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Vertical collection layout for file rows. |
FileRow
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Single file row. Keep FileRowOpen and FileActions as siblings so action buttons are not nested inside the row button. |
FileRowOpen
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"button"> | — | Primary file affordance. Defaults to type="button" and accepts native button props, including disabled. |
FileThumbnail
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Thumbnail slot for an image or composed FilePreview fallback. FilePreview children automatically use the compact treatment. |
FileImage
| Prop | Type | Default | Description |
|---|---|---|---|
fit | "contain" | "cover" | "cover" | Controls object-fit for wide/tall artwork versus ordinary cropped thumbnails. |
...props | useRender.ComponentProps<"img"> | — | Native image props. Provide alt text according to whether the thumbnail is content. |
FileContent
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Flexible content column containing the name and metadata. |
FileName
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Truncated file name. |
FileMeta
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Wrapping metadata row for size, timestamp, or other caller-owned facts. |
FileMetaItem
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Inline metadata item with optional icon. |
FileActions
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Trailing action cluster. Render it beside FileRowOpen, not inside it, to avoid nested buttons. |
FileAction
| Prop | Type | Default | Description |
|---|---|---|---|
variant | ButtonProps['variant'] | "outline" (Brutal) / "ghost" (Elegant) | Optional Button variant override. The theme-aware default matches panel chrome. |
size | ButtonProps['size'] | "icon-sm" | Button size. The default is optimized for trailing row actions. |
...props | ButtonProps | — | All other Button props, including disabled, aria-label, title, render substitution, and click handlers. |