CoolFace
Modelpublic

AbdulElahGwaith/free-react-tailwind-admin-dashboard

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
FileInputExample.tsx22 linesDownload Raw Back to form-elements
1import ComponentCard from "../../common/ComponentCard";2import FileInput from "../input/FileInput";3import Label from "../Label";4 5export default function FileInputExample() {6  const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {7    const file = event.target.files?.[0];8    if (file) {9      console.log("Selected file:", file.name);10    }11  };12 13  return (14    <ComponentCard title="File Input">15      <div>16        <Label>Upload file</Label>17        <FileInput onChange={handleFileChange} className="custom-class" />18      </div>19    </ComponentCard>20  );21}22