Docs
Serializing CSV
Serializing CSV
Copy paste from CSV to Slate.
Deserialize CSV
Copy and paste CSV content into a table.
Installation
npm install @udecode/plate-serializer-csv
Usage
CSV -> Slate
import { createDeserializeCsvPlugin } from '@udecode/plate-serializer-csv';
const plugins = [
// ...otherPlugins,
createDeserializeCsvPlugin(),
];
API
createDeserializeCsvPlugin
Attributes
Collapse all
- Default:
0.25
(This indicates that up to 25% of the rows can contain errors.) - Default:
{ header: true }
(Indicating that the first row of the CSV data should be treated as a header.)
Options.
The tolerance for errors in the CSV data, represented as a percentage in decimal form. This value is calculated as the ratio of errors to the total number of rows.
Options to be passed to the PapaParse library for parsing CSV data.
Refer to PapaParse documentation for more details about these options.