Better Blocks
An enhanced Rich Text (Blocks) editor with inline text color picker, background highlight, customizable color palettes. A drop-in replacement for the native Blocks field.
Strapi - Better Blocks Plugin
An enhanced Rich Text (Blocks) editor for Strapi v5 with inline text color, background highlight, and more.
Table of Contents
- Features
- Compatibility
- Installation
- Configuration
- Usage
- Custom Color Presets
- Frontend Rendering
- Contributing
- License
Features
- Inline Text Color — Apply foreground color to selected text from a configurable palette
- Background Highlight — Apply background color to selected text for highlighting
- Live Preview Button — The toolbar button reflects the currently active text and highlight colors
- Customizable Palettes — Define custom color presets per field via Content-Type Builder
- Dark & Light Mode — Fully compatible with both Strapi themes
- Drop-in Replacement — Works as a custom field alongside the native Rich Text (Blocks) field
- Full Blocks Editor — Paragraphs, headings, lists, links, quotes, code blocks, and all standard text modifiers (bold, italic, underline, strikethrough, code, uppercase, superscript, subscript)
Compatibility
| Strapi Version | Plugin Version |
|---|---|
| v5.x | v0.1.x |
Installation
# Using yarn
yarn add @k11k/strapi-plugin-better-blocks
# Using npm
npm install @k11k/strapi-plugin-better-blocksAfter installation, rebuild your Strapi admin panel:
yarn build
# or
npm run buildConfiguration
1. Enable the plugin
Add the plugin to your Strapi configuration in config/plugins.ts (or config/plugins.js):
// config/plugins.ts
export default () => ({
'better-blocks': {
enabled: true,
},
});2. Restart Strapi
yarn develop3. Add a Better Blocks field
- Go to Content-Type Builder
- Select or create a content type
- Click Add new field
- Switch to the CUSTOM tab
- Select Better Blocks
- Configure the field name and color settings
- Save and wait for Strapi to restart
Usage
Once added to a content type, the Better Blocks field provides an enhanced Rich Text editor with:
Text Color
- Select text in the editor
- Click the A button in the toolbar
- Switch to the Text tab
- Choose a color from the palette
- Click Remove color to reset
Background Highlight
- Select text in the editor
- Click the A button in the toolbar
- Switch to the Highlight tab
- Choose a background color from the palette
- Click Remove highlight to reset
The toolbar button shows a live preview of the active colors — the icon color reflects the text color, and the button background reflects the highlight color.
Custom Color Presets
You can customize both text and background color palettes per field in the Content-Type Builder:
Text Colors
In the field's Base settings:
- Disable default text colors — Check to replace default colors with your own
- Custom text color presets — One color per line in
Label:#HEXformat
Example:
Black:#000000
White:#FFFFFF
Brand Red:#E53E3E
Brand Blue:#3182CEBackground Colors
- Disable default background colors — Check to replace default highlights with your own
- Custom background color presets — One color per line in
Label:#HEXformat
Example:
Warning:#FED7D7
Info:#BEE3F8
Success:#C6F6D5
Neutral:#EDF2F7Default Palettes
Text colors: Teal, Dark, Gray, Light Gray, Silver, Medium Gray, White
Background colors: Yellow, Green, Blue, Pink, Purple, Orange, Gray, Teal, Red, Cyan
Frontend Rendering
To render Better Blocks content in your React frontend, use the companion renderer:
# Using yarn
yarn add @k11k/better-blocks-react-renderer
# Using npm
npm install @k11k/better-blocks-react-rendererimport { BlocksRenderer } from '@k11k/better-blocks-react-renderer';
const MyComponent = ({ content }) => {
return <BlocksRenderer content={content} />;
};The renderer supports all Better Blocks features including text colors, background highlights, images, and all standard block types.
See the @k11k/better-blocks-react-renderer repository for full documentation.
Requirements
- Node.js ≥ 20.0.0
- Strapi v5.x
- Slate 0.94.1 (bundled with Strapi)
Contributing
Contributions are welcome! The easiest way to get started is with Docker:
# Clone the repository
git clone https://github.com/k11k-labs/strapi-plugin-better-blocks.git
cd strapi-plugin-better-blocks
# Start the playground with Docker
docker compose upThis will automatically build the plugin and start a Strapi v5 app (SQLite) at http://localhost:1337/admin.
On first launch, create an admin account, then go to Content-Type Builder → Add new field → CUSTOM tab → Better Blocks to try it out.
Development workflow
- Make changes to the plugin source in
admin/src/orserver/src/ - Restart the container to rebuild and pick up changes:
docker compose restart
Full reset
To wipe the database and node_modules and start fresh:
docker compose down -v && docker compose upWithout Docker
yarn install && yarn build
cd playground/strapi && npm install && npm run developCommunity & Support
- GitHub Issues — Bug reports and feature requests
- GitHub Discussions — Questions and ideas
License
Install now
npm install @k11k/strapi-plugin-better-blocks
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.