Search code examples
javascripthtmlcssreactjsreact-to-pdf

How would I customize the button link of print pdf in the library ReactToPrint?


Here is the code from sandbox

So how would I put the link button Print this out! under the table? could I customize it according to my own design by using CSS?


Solution

  • Simply write it under the table component would be good enough

    <div>
      <ComponentToPrint ref={el => (this.componentRef = el)} />
      <ReactToPrint
        trigger={() => <a href="#">Print this out!</a>}
        content={() => this.componentRef}
      />
    </div>
    

    enter image description here