downloadbutton
v1.0.0
Published
A component to download a js-generated file
Downloads
611
Readme
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
// @demobox
function makeFile() {
// do some calculations
return {
mime: 'text/plain',
filename: 'myexportedfile.txt',
contents: 'all of the exports',
}
}
<DownloadButton
// these classes come from materializecss
className='waves-effect waves-light btn'
genFile={makeFile}/>
For more demos, see the demo page.
Node Start
npm install downloadbutton
var DownloadButton = require('downloadbutton')