You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A React package that simplifies data exporting and clipboard management. It provides react component for printing documents, exporting data as PDF, Excel, and CSV, as well as copying text and structured data to the clipboard.
Small Size
All Export Formate
Export As PDF
Export As CSV
Export As Excel
Copy table data to Clipboard
Copy any text to clipboard
Excel or Sheet to JSON converter
What's new on version 4.0.6
Added onSuccess and onError props to ExportAsExcel, ExportAsPdf, and ExportAsCsv component
Code optimizations
Remove file upload component from this package, Instead I create another package @siamf/upload with more functionality and options. See the docs here
Rename the component ExcelToJsonConverter to ExcelToJson
Huge API change for ExcelToJson component. For more details, read the docs for this component.
React 19 Support
Package Update
Installation
$ npm i @siamf/react-export
import{ExportAsExcel,ExportAsPdf,ExportAsCsv,CopyToClipboard,CopyTextToClipboard,PrintDocument,ExcelToJson}from"@siamf/react-export";//Export as Excel Sheet<ExportAsExceldata={data}headers={["Name","Age","Something"]}>{(props)=>(<button{...props}>
Export as Excel
</button>)}</ExportAsExcel>//Export as pdf<ExportAsPdfdata={data}headers={["CreatedBy","Age","Something Else"]}headerStyles={{fillColor: "red"}}title="Sections List">{(props)=>(<button{...props}>
Export as PDF
</button>)}
</ExportAsPdf>//Export as CSV<ExportAsCsvdata={data}>{(props)=>(<button{...props}>Hello World</button>)}</ExportAsCsv>//Copy to clipboard (Array or Table)<CopyToClipboarddata={data}headers={["CreatedBy","Age","Something Else"]}>{(props)=>(<button{...props}>
Copy Document
</button>)}
</CopyToClipboard>//Copy to clipboard (text)<CopyTextToClipboardtext="Hello World">{(props)=>(<button{...props}>
Copy Text
</button>)}</CopyTextToClipboard>//Print data<PrintDocumentdata={data}headers={["CreatedBy","Age","Something Else"]}>{(props)=>(<button{...props}>
Copy Text
</button>)}
</PrintDocument>//Excel to json converter or Read Excel File<ExcelToJson>{({
isDragging,
dragProps,
onFileUpload,
error,
data,
file
})=>(<div{...dragProps}onClick={onFileUpload}>
Upload Excel File
</div>)}</ExcelToJson>