View this page rendered at notablemind.github.io/downloadbutton
DownloadButton is a simple component for letting the user download a
javascript-generated file. It was extracted from
Notablemind.
The styling is due to materializecss, and does
not come with the DownloadButton
component. In some examples,
FontAwesome icons are also used.
You are free to style the component however you wish.
Demo
function makeFile() {
return {
mime: 'text/plain',
filename: 'myexportedfile.txt',
contents: 'all of the exports',
}
}
<DownloadButton
className='waves-effect waves-light btn'
genFile={makeFile}/>
For more demos, see the demo page.
Node Start
npm install downloadbutton
var DownloadButton = require('downloadbutton')