https://github.com/axetroy/react-download
react component for click and then download the specify content file.
https://github.com/axetroy/react-download
download react react-component react-download
Last synced: over 1 year ago
JSON representation
react component for click and then download the specify content file.
- Host: GitHub
- URL: https://github.com/axetroy/react-download
- Owner: axetroy
- License: mit
- Created: 2017-05-16T18:42:35.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T12:43:00.000Z (about 7 years ago)
- Last Synced: 2025-03-17T14:22:11.653Z (over 1 year ago)
- Topics: download, react, react-component, react-download
- Language: JavaScript
- Homepage: https://axetroy.github.io/react-download/
- Size: 267 KB
- Stars: 36
- Watchers: 1
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-download
react component for click and then download the specify content file.
[Online Demo](https://axetroy.github.io/react-download/)
### Installation
```bash
npm install @axetroy/react-download
```
### Usage
```javascript
import React from 'react';
import { render } from 'react-dom';
import Download from '@axetroy/react-download';
const element = document.createElement('div');
document.body.appendChild(element);
class App extends React.Component {
render() {
return (
Click and Download file
);
}
}
render(, element);
```
### Props
- file
download file name
- content
the file content you want to download
### Run the Demo
```bash
git clone https://github.com/axetroy/react-download.git
yarn
yarn start
```
### License
The [MIT License](https://github.com/axetroy/react-download/blob/master/LICENSE)