1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-18 05:01:17 +02:00

update docs

This commit is contained in:
Ian Storm Taylor
2016-07-11 13:22:41 -07:00
parent b2a94d7efb
commit a7dd173dea

View File

@@ -5,7 +5,21 @@ The top-level React component that renders the Slate editor itself.
```js ```js
<Editor <Editor
plugins={Array}
state={State}
/>
```
The editor takes a `State` instance that contains it's content and selection, and an array of `plugins` that define its behavior.
In addition to those two properties, the editor allows passing any of the properties that a plugin can define:
```js
<Editor
onBeforeInput={Function}
onChange={Function} onChange={Function}
onKeyDown={Function}
onPaste={Function}
plugins={Array} plugins={Array}
renderDecorations={Function} renderDecorations={Function}
renderMark={Function} renderMark={Function}
@@ -14,9 +28,8 @@ The top-level React component that renders the Slate editor itself.
/> />
``` ```
The editor takes a `State` instance that contains it's content and selection. These properties are actually an implicit plugin defintion. Internally, they are grouped together and turned into a plugin that is given first priority in the plugin stack.
Most of the editor's other properties are actually an implicit plugin defintion. Internally they are grouped together and turned into a plugin that is given first priority in the plugin stack.
#### Properties #### Properties