codoeditor
v1.1.19
Published
A front end Editor for React applications.
Downloads
9
Readme
Codoeditor - A frontend page editor for React applications.
The editor provides ready made blocks e.g. Heading Block or Paragraph Block (more blocks coming soon). These blocks can be used to create content for pages or posts. The editor provides the output (JSON) to the callback function which can be saved in the database.
Setup
- Install the codoeditor package i.e. npm install --save codoeditor
- import the Editor component i.e. import Editor from 'codoeditor';
- Now add the Editor component in React application
Example:
import {Editor} from 'codoeditor';
function App() {
/*Saved in the database*/
const data = [
{
type: "heading",
tagName: "h1",
attributes: {
className: "hey some"
},
children: "Hello World!",
settings: {
tagName: "h1"
}
}
];
const handleEditorData = (data) => {
console.log(data); //save the data to the state or database
}
return (
<div className="App">
<Editor
data={data}
handleEditorData={handleEditorData}
coreBlocks={""}
></Editor>
</div>
);
}
export default App;