Skip to content
Available for new work
Pages in Blog

GuidePremium

Text blocks in CoullWorks Blog for Laravel

The heading, text, quote, callout, code and divider blocks: what each is for, how to add it, every field with its limits, how it renders and the stored JSON, with screenshots.

Updated 16 November 2026Back to the package pageBuy

These six blocks carry the words of an article. For how to add, move and delete blocks see the block editor. The editor screenshots show the Edit block dialog that opens from the gear on a block's line; the rendered screenshots are the same block on the Blade front end of the demo blog.

Every block is stored as { "type": "...", "v": 1, "data": { ... } }. Only the data object is shown below. Where a rule says "required" the editor marks the field with a red star, and the server refuses a save that lacks it. Messages not quoted below are the standard Laravel validation messages for the field.

Heading#

The Heading block form: Text, Level and Anchor

The Heading block form. Text and Level are required; Anchor is left empty and made from the text.

A rendered Heading block: the text Start with the weather you expect as a section heading

The same heading on the page.

What it is for. A section heading inside the article. Headings are not decoration: they feed the Toc block, the contents list in the article rail and the jump links, so use a Heading block (not bold text) for every section.

Add it. Picker group text, entry Heading.

Field (label)TypeRequiredDefaultAllowed values and validationWhat it does
Text (text)Text inputYesEmptyUp to 255 charactersThe words of the heading.
Level (level)SelectYesh2h2, h3, h4The heading level. The page title is the h1, so the first level to use is h2.
Anchor (anchor)Text inputNoEmptyUp to 120 characters; lower-case letters and digits in groups joined by single hyphens, for example weather-you-expectThe id that links to the heading. When empty it is made from the text, for example start-with-the-weather-you-expect. Two headings that would get the same anchor get -2, -3 and so on.

Stored: { "text": "Start with the weather you expect", "level": "h2", "anchor": null }.

Tips. Keep levels in order (an h3 under an h2). The Toc block lists h2 only or h2 and h3; h4 never appears in it. Set an Anchor only when you link to the heading from elsewhere and need the address to stay stable after you reword it.

Common mistakes. Typing capitals, spaces or underscores in Anchor (it must be lower-case with hyphens). Using a Heading block for a short bold line that is not a section.

Text#

The Text block form: one Body field with the full rich text toolbar

The Text block form. The Body is a rich text editor with the full toolbar.

A rendered Text block: two paragraphs of body copy

Two paragraphs on the page.

What it is for. Body copy: paragraphs, lists, links, small tables inside the text. It is the block you will use most.

Add it. Picker group text, entry Text.

Field (label)TypeRequiredDefaultAllowed values and validationWhat it does
Body (body)Rich text editor, full toolbarYesEmptyText; HTML is cleaned on saveThe paragraphs. The toolbar offers bold, italic, underline, strikethrough, subscript, superscript, link, two heading sizes, text alignment, bulleted and numbered lists, undo and redo (plus a few more block tools; the screenshot shows the whole bar).

Stored: { "body": "<p>Most people buy a tent the way they buy a mattress.</p><p>...</p>" }. The HTML is sanitised when the post is saved, so a script or an event attribute pasted into it is dropped.

Tips. Use one Text block for a run of paragraphs. Start a new block when you need a heading, image or other block between them. Headings made inside the rich editor do not feed the contents list; use a Heading block for that.

Common mistakes. Putting section headings in the rich editor (they are missing from the Toc and the rail), and pasting from a word processor with its own fonts and colours, which the cleaner strips.

Quote#

The Quote block form: Quote, Citation and Citation url

The Quote block form. Quote is a four-row text area; the two citation fields are single lines.

A rendered Quote block: italic quotation with an accent bar and the citation under it

The quotation with its citation, "Tom Okafor".

What it is for. A quotation set apart from the text, with who said it.

Add it. Picker group text, entry Quote.

Field (label)TypeRequiredDefaultAllowed values and validationWhat it does
Quote (quote)Text areaYesEmptyUp to 5000 characters, plain textThe quotation.
Citation (citation)Text inputNoEmptyUp to 255 charactersWho said it. Shown under the quote after a dash.
Citation url (citation_url)Text inputNoEmptyUp to 2048 characters; must start with http:// or https://Links the citation to the source.

Stored: { "quote": "The best tent is the one you are willing to pitch in the rain.", "citation": "Tom Okafor", "citation_url": null }.

Tips. Put the source link in Citation url so readers (and search engines) can check the quotation. Leave the quotation marks out of the Quote field; the block adds the styling.

Common mistakes. A Citation url without https://, which fails validation.

Callout#

The Callout block form: Variant, Title and a rich text Body

The Callout block form with the info variant, a title and a body.

A rendered Callout block: a shaded box with an accent bar, a bold title and a paragraph

The callout on the page.

What it is for. A boxed note the reader should not miss: a tip, a warning, a side fact. It is drawn as an aside with role="note", so assistive technology announces it as a note.

Add it. Picker group text, entry Callout.

Field (label)TypeRequiredDefaultAllowed values and validationWhat it does
Variant (variant)SelectYesNone chosen (the render falls back to the info look)info, tip, warning, noteSets the colour of the bar at the box's edge.
Title (title)Text inputNoEmptyUp to 255 charactersA short heading for the box.
Body (body)Rich text editor, full toolbarYesEmptyText; HTML is cleaned on saveThe note itself.

Stored: { "variant": "info", "title": "What free-standing really means", "body": "<p>...</p>" }.

Tips. Choose the variant for what the note is (warning for something that can go wrong), not for the colour. Keep a callout to a few lines; use a Section for anything longer.

Common mistakes. Leaving Variant unset (it is required), and using several callouts in a row, which stops each from standing out.

Code#

The Code block form: Language, Filename, Code, Line numbers, Highlight lines and Wrap

The Code block form for a bash script, with line numbers on and lines 6-8 marked.

A rendered Code block: a file name bar, line numbers and three highlighted lines

The listing on the page. Wrap is off, so the long comment on line 2 scrolls sideways.

What it is for. A listing of code, a command or a config file, with syntax colours.

Add it. Picker group text, entry Code.

Field (label)TypeRequiredDefaultAllowed values and validationWhat it does
Language (language)SelectYesplaintextphp, js, ts, jsx, tsx, json, bash, html, css, scss, less, sql, xml, yaml, python, graphql, diff, twig, plaintextPicks the colours.
Filename (filename)Text inputNoEmptyUp to 255 charactersA name shown in a bar above the code.
Code (code)Monospace text area, eight rowsYesEmptyUp to 200,000 charactersThe code, kept exactly as typed.
Line numbers (line_numbers)ToggleNoOffOn or offNumbers the lines. The numbers are not copied when a reader copies the code.
Highlight lines (highlight_lines)Text inputNoEmptyUp to 120 characters, numbers and ranges joined by commas, for example 2-3,5Marks those lines. A value such as two or 3- fails validation.
Wrap (wrap)ToggleNoOffOn or offWraps long lines instead of scrolling sideways.

Stored: { "language": "bash", "filename": "route.sh", "code": "#!/usr/bin/env bash\n...", "line_numbers": true, "highlight_lines": "6-8", "wrap": false }.

Tips. The package ships its own small tokenizer (about 13 KB, no network). A post page loads it once, and only when the post has a code block. With JavaScript off the code is plain readable text, and the code area is focusable so a keyboard user can scroll it. Use diff for changes and plaintext for output.

Common mistakes. Pasting code into a Text block (it loses its spacing), and a Highlight lines value that is not numbers and ranges.

Divider#

The Divider block form: one Style select set to line

The Divider block form has one field.

Rendered dividers between paragraphs: a thin grey line, then a row of small dots, then an empty gap

Three dividers among paragraphs, in the order line (a thin grey rule across the column), dots (a row of small dots) and space (an empty gap with no mark).

What it is for. A pause between parts of an article.

Add it. Picker group layout, entry Divider.

Field (label)TypeRequiredDefaultAllowed values and validationWhat it does
Style (style)SelectYeslineline, dots, spaceline is a thin rule, dots a row of dots, space an empty gap.

Stored: { "style": "line" }.

Tips. line and dots are drawn as a real separator (hr). space is a spacer hidden from assistive technology, so it announces nothing. Use space for rhythm, not to push content down.

Common mistakes. Using a divider before every heading; headings already separate sections.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.