1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-23 16:55:23 +01:00
slate/docs/concepts/plugins.md

21 lines
1.4 KiB
Markdown
Raw Normal View History

2016-07-12 21:34:31 -07:00
2016-07-12 22:14:12 -07:00
# Plugins
2016-07-12 21:34:31 -07:00
2016-07-12 22:14:12 -07:00
In Slate, all custom logic added to the editor is done via plugins. Plugins have complete control over the schema, the behaviors, and the rendering of the components of the editor. Slate encourages you to break up code into small, reusable modules that can be shared with others, and easily reasoned about.
_To learn more, check out the [Using Plugins guide](../guides/using-plugins.md), or the [Plugins reference](../reference/plugins/plugins.md)._
2016-07-12 22:24:07 -07:00
### The Core Plugin
2016-07-12 22:14:12 -07:00
The "core" plugin that ships with Slate is where the default editing behavior is kept. It performs actions like splitting the current block when `enter` is pressed, or inserting a string of text when the user pastes from their clipboard. But it stops short of anything opinionated, leaving that for userland plugins to add.
_To learn more, check out the [Core Plugin reference](../reference/plugins/core.md)._
2016-07-12 22:24:07 -07:00
### The Editor Plugin
2016-07-12 22:14:12 -07:00
2016-07-16 01:35:18 +10:00
Plugins are so central to Slate's architecture, that the properties of the [`<Editor>`](../reference/components/editor.md) that allow you to add custom functionality (eg. `onKeyDown` or `onPaste`) are actually implemented as a plugin too. All of those properties actually just create an implicitly, top-priority plugin that gets added at the beginning of the editor's plugin stack. But you'd never even know it!
2016-07-12 22:14:12 -07:00
_To learn more, check out the [`<Editor>` component reference](../reference/components/editor.md)._