An open API service indexing awesome lists of open source software.

https://github.com/k11k-labs/better-blocks-react-renderer

React renderer for Strapi v5 Blocks content with color and backgroundColor support from Better Blocks plugin
https://github.com/k11k-labs/better-blocks-react-renderer

better-blocks blocks-editor color headless-cms highlight open-source react renderer rich-text strapi strapi-v5 typescript

Last synced: 3 months ago
JSON representation

React renderer for Strapi v5 Blocks content with color and backgroundColor support from Better Blocks plugin

Awesome Lists containing this project

README

          

Better Blocks React Renderer

React renderer for Strapi v5 Blocks content — supports all standard blocks plus Better Blocks features: color, highlight, text alignment, nested lists, to-do lists, tables, media embeds, image captions, and more.



npm version


npm downloads


license


Strapi editor (left) and rendered output (right)

---

## Table of Contents

1. [Why?](#why)
2. [Compatibility](#compatibility)
3. [Installation](#installation)
4. [Usage](#usage)
5. [Supported Blocks](#supported-blocks)
6. [Supported Modifiers](#supported-modifiers)
7. [Custom Renderers](#custom-renderers)
8. [TypeScript](#typescript)
9. [Contributing](#contributing)
10. [License](#license)

---

## Why?

The official [`@strapi/blocks-react-renderer`](https://github.com/strapi/blocks-react-renderer) doesn't support the features that the [Better Blocks](https://github.com/k11k-labs/strapi-plugin-better-blocks) plugin adds to the Strapi editor — color marks, text alignment, to-do lists, tables, media embeds, and more.

This package is a **drop-in replacement** that renders all Better Blocks features out of the box — no configuration needed.

## Compatibility

| Strapi Version | Renderer Version | React Version |
| -------------- | ---------------- | ------------- |
| v5.x | v0.x | ≥ 17 |

## Installation

```bash
# Using yarn
yarn add @k11k/better-blocks-react-renderer

# Using npm
npm install @k11k/better-blocks-react-renderer
```

**Peer dependencies:** `react >= 17`

## Usage

```tsx
import { BlocksRenderer } from '@k11k/better-blocks-react-renderer';

// Basic — renders all blocks including color/highlight
;
```

That's it. All Better Blocks features — colors, tables, to-do lists, media embeds, alignment, and more — work automatically.

## Supported Blocks

| Block | Default element | Source |
| ------------------------------- | ------------------- | --------------------------- |
| `paragraph` | `

` | Strapi core |
| `heading` (1–6) | `

`–`

` | Strapi core |
| `list` (ordered/unordered/todo) | `
    ` / `