JustFlows

Block editor

The visual page builder, the block JSON document, patterns, and how plugins add blocks.

6 min read

Open Admin → Content → a page or post → Builder. The builder is a fullscreen React editor outside the usual admin shell. It loads registered blocks from GET /api/blocks and optional patterns from GET /api/themes/patterns (and GET /api/themes/patterns/:slug).

Document format

json
{
  "version": 1,
  "blocks": [
    {
      "type": "core.heading",
      "props": { "text": "Hello", "level": 2 }
    },
    {
      "type": "core.paragraph",
      "props": { "text": "Welcome to the site." }
    }
  ]
}

Layout blocks (core.section, core.container, core.group, core.columns, core.column) nest children. Columns contain core.column nodes. HTML and rich text go through sanitizers in @justflows/blocks (sanitizeHtmlBlock, sanitizeRichText, safe URLs for hrefs and media).

Authoring flow

  1. 1

    Insert

    Pick a core block or a theme pattern. Patterns are starter trees from the active theme.

  2. 2

    Edit props

    Each block has a schema (text, richtext, number, media, and so on). The registry validates props before render.

  3. 3

    Save and publish

    The document is stored on the content row. Public HTML is produced by each block’s render() plus the content.render filter.

Tip

The full catalogue of shipped types is on Core blocks. Plugins can register more types through the block registry.