Overview
Plugins are the building blocks of Yoopta Editor. Each plugin represents a specific type of content block (paragraph, heading, image, etc.) and defines how that content is rendered and behaves.Available Plugins
Yoopta Editor provides a rich set of built-in plugins:Text Plugins
- Paragraph - Basic text blocks
- Headings - H1, H2, H3 heading blocks
- Blockquote - Quote blocks
List Plugins
- BulletedList - Unordered lists
- NumberedList - Ordered lists
- TodoList - Checkable task lists
Media Plugins
- Image - Image blocks with upload support
- Video - Video blocks with upload support
- File - File attachment blocks
- Embed - Embed external content (YouTube, Twitter, etc.)
Layout Plugins
- Table - Tabular data
- Accordion - Collapsible content sections
- Divider - Horizontal separator
- Callout - Highlighted notice blocks
Special Plugins
- Code - Syntax-highlighted code blocks
- Link - Link blocks
Using Plugins
Basic Usage
Headings Plugin
The Headings plugin exports multiple heading types:Lists Plugin
The Lists plugin exports multiple list types:Plugin Configuration
Most plugins accept configuration options:Image Plugin
Code Plugin
Video Plugin
Plugin Methods
extend()
Extend a plugin with custom options:Plugin Structure
Each plugin has the following structure:Custom Renders
Override default rendering:Plugin Events
Handle plugin-specific events:Plugin Shortcuts
Define custom keyboard shortcuts:Common Plugin Options
Most plugins support these common options:Display configuration -
title - Display name in UI - description - Plugin description - icon- Custom icon component
Keyboard shortcuts to trigger the plugin
Slate-specific configuration
Plugin Loading Order
The order of plugins in the array affects:- Menu display order
- Transform priority
- Shortcut precedence
Conditional Plugin Loading
Load plugins based on conditions:Plugin Detection
Check if a plugin is loaded:Best Practices
Always include Paragraph plugin
Always include Paragraph plugin
The Paragraph plugin should always be included as it’s the default block type.
Define plugins outside component
Define plugins outside component
Define your plugins array outside the component to prevent recreation on every render.
Use extend() for customization
Use extend() for customization
Use the
extend() method instead of modifying plugin objects directly.Handle async operations properly
Handle async operations properly
For plugins with async operations (uploads, etc.), always handle errors and loading states.