Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rot1024/use-file-input
React Hooks for file selection with hidden <input type="file" />
https://github.com/rot1024/use-file-input
file-select file-upload hooks react
Last synced: about 1 month ago
JSON representation
React Hooks for file selection with hidden <input type="file" />
- Host: GitHub
- URL: https://github.com/rot1024/use-file-input
- Owner: rot1024
- License: mit
- Created: 2019-07-04T05:14:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-10T00:36:59.000Z (over 3 years ago)
- Last Synced: 2024-11-01T10:42:59.466Z (2 months ago)
- Topics: file-select, file-upload, hooks, react
- Language: JavaScript
- Homepage:
- Size: 61.5 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-hooks - use-file-input - React Hooks for file selection with hidden <input type="file" /> (Packages)
README
# use-file-input
React Hooks for selecting files with hidden ``
```sh
npm install --save use-file-input
# or
yarn add use-file-input
```## Usage
```jsx
import useFileInput from "use-file-input";const Component = () => {
const handleFileSelect = useFileInput(
(files) => {
// files is FileList
// do something with selected files
},
{ accept: "image/*", multiple: true }
);return (
Select files
);
};
```## License
MIT License