{"repo":"react-component/upload","free":true,"listed":false,"github":"https://github.com/react-component/upload","clone":"git clone https://github.com/react-component/upload.git","description":"📤 Low-level React upload primitive for Ajax, drag, paste, directory, and custom requests.","language":"TypeScript","stars":803,"topics":["ant-design","antd","javascript","react","react-component"],"license":"MIT","category":"ui-components","readme_excerpt":"@rc-component/upload Part of the Ant Design ecosystem. 📤 Low-level React upload primitive for Ajax, drag, paste, directory, and custom requests. English 简体中文 Highlights - Supports Ajax uploads with progress, headers, credentials, and custom request overrides. - Supports directory, drag, paste, async action, and before-upload flows. - Exposes abort(file) through the component instance for active requests. - Provides semantic classNames and styles slots for the hidden input. Install Usage Online preview: https://upload.react-component.vercel.app/ Examples Run the local dumi site: Then open http://localhost:8000 . API Upload Name Type Default Description --- --- --- --- accept string \\ AcceptConfig - Input accept config. action string \\ (file) = string \\ PromiseLike - Upload URL or async resolver. beforeUpload (file, fileList) = BeforeUploadFileType \\ Promise \\ void - Validate or transform before upload. Return false to stop upload. className string - Root class name. classNames { input?: string } - Semantic class names. component React.ComponentType \\ string 'span' Root component. customRequest CustomUploadRequestOption - Override default request behavior. data object \\ (file) = object {} Extra upload data. directory boolean false Enable directory upload. disabled boolean false Disable upload trigger. hasControlInside boolean false Whether child already contains a control element. headers Record {} Request headers. id string - Input id. method 'POST' \\ 'PUT' \\ 'PATCH' \\ 'post'","default_branch":null,"files":null,"tree":[],"storefront":"/r/react-component","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/react-component/upload/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}