Programmatically add blocks

866 Views Asked by At

What would be the best way to add (and render) blocks of text on the fly from a js script ?

My users have a fairly complex set of data entry to fill which when they validate an option should generate a block of text which I would then need to insert into an existing EditorJS document. The same process can happen several time before the document is considered complete.

1

There are 1 best solutions below

1
On

The blocks.insert() API method will do what I need, not sure why I missed it originally