DEV Community

Discussion on: Can we make a download button in ReactJs?

Collapse
giseleml profile image
Gisele Leonardi • Edited on

Yes you can, all you have to do is pass your download function to the onClick event!

const onDownload = () => console.log('Download')

<button onClick={onDownload}>Download My Resume</button>
Enter fullscreen mode Exit fullscreen mode
Collapse
vehbirestelica profile image
Vehbi Restelica Author

Okay, but is there any library, method to add PDF viewer in react?

Collapse
giseleml profile image
Gisele Leonardi

Yeah of course. The most popular is react-pdf github.com/diegomura/react-pdf