🚧 MateChat React document is still under development

FileUpload

FileUpload is a simple file upload button with support for multiple file selection.

Installation

pnpm dlx shadcn@latest add https://matechat.noctisynth.org/r/file-upload.json

Examples

import { FileUpload } from "@matechat/react";
import { useState } from "react";

export default function () {
  const [files, setFiles] = useState<File[]>([]);
  return (
    <div className="flex gap-4 items-center">
      <FileUpload
        onFilesSelect={(files) => {
          setFiles(files);
        }}
      />
      {files.length > 0 && (
        <span className="text-sm text-gray-600">
          {files.length} file(s) selected
        </span>
      )}
    </div>
  );
}

Properties

FileUpload

PropertyDescriptionTypeDefault Value