How can we make export ( pdf, csv )?

Hello,

I have made a simple table, and I want to have functionality to export the data of this table? How is this possible with forge.

Of course it does not need to be a table, it could be any text inside my modal.

In this case I use “contentAction”.

I am using UI Kit, can I do something like that with UI Kit, or should I change to Custom ?

Thanks,
Michalis

This sort of thing works:

  const exportCSV = async () => {
      const blob = new Blob([...], { type: 'text/csv' })
      const link = document.createElement('a')
      link.href = URL.createObjectURL(blob)
      link.download = 'export.csv'
      link.click()
      URL.revokeObjectURL(link.href)
  }

<Button onClick={exportCSV}>Export CSV</Button>

Just ask AI to generate the rest.

1 Like