Skip to content
v0.2.10

UploadItem

A host-controlled upload row with explicit progress and applicable actions.

Preview
  • Brand guidelines.pdfPDF2.4 MB
    Uploading · 45%
    Uploading: Brand guidelines.pdf

Use UploadItem

UploadItem 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
upload-item.tsxTSX
"use client";

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

export function Example() {
  return (
    <FloodRoot>
      <UploadList label="Uploads">
        <UploadItem name="Brand guidelines.pdf" size={2400000} state="uploading" progress={45} />
      </UploadList>
    </FloodRoot>
  );
}

Design notes

  • Queued/uploading can expose cancel; error/cancelled can expose retry; settled rows can expose remove.
  • Unknown progress is indeterminate. StatusIndicator and Progress remain distinct reused primitives; their row can wrap when the list container is constrained. No network or upload queue is built in.

API reference

PropValuesDefault
namestringRequired
sizenumber—
mimeTypestring—
formatstring | null—
thumbnailReactNode—
hrefstring—
downloadboolean—
onPreview() => void—
onRemove() => void—
disabledboolean—
labelsFileActionLabels—
formatSize(bytes: number) => string—
state"queued" | "uploading" | "success" | "error" | "cancelled"Required
progressnumber—
errorstring—
onCancel() => void—
onRetry() => void—
Native HTML propsOmit<Omit<HTMLAttributes<HTMLLIElement>, "children" | "title">, "description">Forwarded
View TypeScript source