파일 업로드 File upload
파일 업로드는 하나 이상의 디바이스의 로컬 파일을 선택하고 첨부하는 데 사용하는 입력 컴포넌트이다.
기본
tsx
import { FileUpload } from '@krds.ui/react'
export default function FileUploadDemo() {
return <FileUpload title="증빙 서류 첨부" description="PDF, JPG, PNG · 10MB 이하" />
}FileUpload
Props
| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
className | string | - | |
title | string | - | |
disabled | boolean | false | |
description | string | - | |
uploadText | string | 첨부할 파일을 여기에 끌어다 놓거나, 파일 선택 버튼을 눌러 파일을 직접 선택해주세요. | |
maxFiles | number | 10 | |
maxFileSize | number | 20 * 1024 * 1024 | |
acceptedFileTypes | string[] | - | |
files | FileItem[] | - | |
onFilesChange | ((files: FileItem[]) => void) | - | |
onFileUpload | ((file: File) => Promise<void>) | - | |
onFileDelete | ((fileId: string) => void) | - | |
onAllFilesDelete | (() => void) | - | |
allowDelete | boolean | true |