Miss any of our Open RFC calls?Watch the recordings here! »

react-download-link

2.3.0 • Public • Published

react-download-link

A simple component to download data from a client-side cache (e.g. flux, redux).

Design to be used with browserify or webpack.

Install with:

npm install --save react-download-link

Include with:

import DownloadLink from "react-download-link";

Use:

<DownloadLink
    label="Save"
    filename="myfile.txt"
    exportFile={() => "My cached data"}
/>

Or with Promises:

<DownloadLink
    label="Promise to Save"
    filename="myfile.txt"
    exportFile={() => Promise.resolve("My cached data")}
/>

The component will default to an anchor tag, but the tagName prop will accept a string of any other HTML tag you prefer, such as 'button'.

Install

npm i react-download-link

DownloadsWeekly Downloads

6,965

Version

2.3.0

License

MIT

Unpacked Size

7.78 kB

Total Files

6

Last publish

Collaborators

  • avatar
  • avatar