Page builder
The page builder
Every entry has content: text and the blocks its type allows. Editors work on the Content tab, which is the page drawn by your own Blade views. Text is typed where it shows, and a block's fields open beside it.

A block is a PHP class
Its fields are declared as a content type's are. #[Icon] and #[Description] are what the inserter lists it by, #[Example] is what it previews, and a Blade view at blocks.{handle} draws it.
#[Icon('quote')]
#[Description('A line the reader should not miss.')]
#[Example(['text' => 'Mainstay is not released yet.'])]
class Note extends Block
{
#[Textarea(required: true)]
public string $text;
}
<div class="note">
<p>@field($block, 'text')</p>
</div>
Blocks hold blocks
#[Blocks] on a block's class names the blocks that go inside it, and text: true lets text sit among them. Its view prints them with @inner($block), and the editor drags blocks into and out of it.
#[Icon('grid')]
#[Example(inner: [Card::class, Card::class])]
#[Blocks([Card::class])]
class Cards extends Block
{
#[Select(options: ['cards' => 'Cards', 'tiles' => 'Small tiles'])]
public string $size = 'cards';
}

Edits wait as a draft
Everything done on the page is saved as a draft of what differs. Publish puts it live in one transaction and keeps the version it replaced, which the entry's history restores while it is among the newest 50.

The block toolbar
Selecting a block brings its toolbar with it, floating by the block, so nothing on the page moves to make room.
Drag
Into another block, or out of one.
Move up, move down
One place at a time.
Bold, italic, code
On the text selected.
Block settings
Its fields and images, in a dialog.
Duplicate
A copy beside it.
Delete
Off the page.
How blocks are stored
An entry's content is a document in a JSON column, its blocks typed data in it and never HTML. Blade draws them on every request, so changing a view changes every page that holds the block.
{
"type": "block",
"attrs": {
"id": "01K8ZQ4V7M3N2D5R6T8W9X0Y1A",
"type": "note",
"data": {
"text": "Mainstay is not released yet."
}
}
}
One handle, one block
A block's handle names the view that draws it across the whole site, so two blocks of one handle are refused. A plugin names its blocks its own.
Removed blocks are skipped
A block of a type its list no longer names is left out when it is read, so a removed block type is skipped when read.
Fields read from nothing
A block saved before a field was added reads it as the default its property declares, or as empty.