This example uses React and styled-components to generate a monthly statement PDF via Anvil's HTML to PDF API. You can use this as a jumping off point to generate a PDF with your own custom React / styled-components code via.
To run it, yarn install
at the root of this repo, then run:
ANVIL_API_TOKEN=your_token yarn generate-pdf:react && open ./generate-react.output.pdf
See the generate-pdf.js script, and components
directory here for the code.
You can also view this template in a browser if you'd like. From the root directory, start the web server:
yarn web:react
Then visit localhost:8086