Skip to content
v0.2.10

FileItem

A named file row with size, type, thumbnail and independent actions.

Preview
  • Brand guidelines.pdfPDF2.4 MB

Use FileItem

FileItem is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
file-item.tsxTSX
"use client";

import { FloodRoot, FileList, FileItem } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <FileList label="Attachments">
        <FileItem name="Brand guidelines.pdf" size={2400000} mimeType="PDF" />
      </FileList>
    </FloodRoot>
  );
}

Design notes

  • Render inside FileList or another native list.
  • No file reading, object URL creation or uploading is performed.

API reference

PropValuesDefault
namestringRequired
sizenumber—
mimeTypestring—
formatstring | null—
thumbnailReactNode—
descriptionReactNode—
hrefstring—
downloadboolean—
onPreview() => void—
onRemove() => void—
disabledboolean—
labelsFileActionLabels—
formatSize(bytes: number) => string—
Native HTML propsOmit<HTMLAttributes<HTMLLIElement>, "children" | "title">Forwarded
View TypeScript source