1.0.0 • Published 9 years ago

downloadbutton v1.0.0

Weekly downloads
208
License
MIT
Repository
github
Last release
9 years ago

<!--

title: DownloadButton Demos colors: pink fontPair: Fugaz One ga: UA-7002862-5 source: https://github.com/notablemind/downloadbutton/raw/master/Readme.md css: | .DownloadButton { font-size: 16px; font-family: sans-serif; } styles:


-->

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')