Skip to content

Latest commit

 

History

History
88 lines (63 loc) · 3.66 KB

README.md

File metadata and controls

88 lines (63 loc) · 3.66 KB

DM Editor documentation

Concepts & principles

See DM Editor concepts and principles to use DM Editor better.

Installation

npm install dmeditor

First example

import { registerDefaultWidgets, DMEditor } from "dmeditor";

registerDefaultWidgets();

const App = () => {
  return (
    <div>
      <DMEditor />
    </div>
  );
};

Sample projects

Tutorial

Use DM Editor

Develop a widget

API Reference

Use DM Editor & style blocks

API Comment
DMEditor DMEditor, DMEditorView, dmeServerSideLoad
registerStyle Register style, style options
setDMEditorConfig Set configurations like predefined colors
Callback configs Eg. for integrate with image library
CSS variables & classes DM Editor defined css variables and classes
Widget style keys Style keys on built in widgets

Develop a widget

API Comment
registerWidget Register a widget
WidgetRenderProps Props to implement widget render
Hooks useEditorStore, useDevice
Render block, block list BlockRender, BlockListRender
Setting components Setting component like input, checkbox, width, etc
Utility components Utility component useful for creatint widget, eg. MiniRichText

Extra resources

Code as default settings/styles in project.

Comment
Default styles Built in widget styles using css-in-js
Default tailwind styles Built in widget styles using tailwind

Links