Content modelingThe custom section

The custom section

The one section editors lay out themselves: rows of richtext columns on a 12-column grid, offered where a zone allows it. You turn it on, pick what its columns may hold, and style the result; Smoodly owns the grid.

View as Markdown

To write a section of your own in code, see Sections.

Turning it on

A zone offers the custom section when its policy says so. The starter's body zones do:

components/pages/Home.schema.ts
  zones: {
    hero: z.locked(heroSchema),
    body: z.freeform({ sections: [imageTextSchema, pointsSchema, favouriteArticlesSchema, peopleSchema, quoteSchema], custom: true }),
  },

Only z.freeform() takes custom: true. Custom section then appears in Add section after the listed sections.

What a column may hold comes from the config's toolset. The starter gives the columns its article toolset, so a column can hold headings, lists, images and the two elements:

smoodly/config.ts
export const config = defineConfig({
  // …
  custom: { toolset: article },
});

The columns render through the package's own richtext view, with images through Astro's image service and your elements by file name. There is nothing to bind.

Without custom in the config, the columns take the richtext default plus images. breakpoint sets where rows stack; the default is 48rem.

What editors get

A new custom section is one row with one column. Each row is a card in the inspector:

ColumnsA stepper from one to six. Removing a column folds its content into the last one, so nothing is lost.
WidthsA bar dragged in twelfths, with presets such as 1/2 · 1/2 and 1/3 · 2/3. Spans always add up to 12.
GapS, M or L between the columns.
Vertical alignTop, Center, Bottom or Stretch.
Reverse on mobileFlips the column order when the row stacks, so a photo can sit right on desktop and first on a phone.
Column 1, Column 2, …A richtext editor per column, with the toolset from the config.

Rows move up and down, and a section keeps at least one. In the canvas the section is labeled by its first row, Custom section · 2 columns, and clicking a column reveals its editor in the inspector. Like any section it has Spacing & layout and, when the config allows, Custom CSS on its Settings tab.

How it renders

The section renders through the same wrapper as yours, so spacing, width, selection and the CSS box come free. Smoodly adds one scoped style per custom section, computed from the stored numbers only:

  • Each row is a grid, .smd-row, with its spans as fr tracks, its gap and its vertical alignment. Rows sit 2rem apart.
  • A row's width is var(--smd-width, var(--container, none)), with var(--smd-gutter, 1rem) at the sides, so define --container and --smd-gutter once and rows line up with your other sections.
  • Below the breakpoint every row stacks to one column, and a reversed row stacks bottom-up.

Your stylesheet styles the content. Each column is a .smd-col; the starter gives it the same rules as its prose:

app/globals.css
/* The custom section's columns (.smd-col) read like prose. */
.prose, .smd-col { display: flex; flex-direction: column; gap: 20px; font-size: 17px; line-height: 1.65; color: var(--muted); }
.prose h2, .smd-col h2 { font-size: 32px; margin-top: 8px; }

Nothing else is required: a site with no rules for .smd-col still gets working columns.

What it cannot do

A column holds richtext: text, headings, lists, images and elements. It never holds a section or another row, so the nesting stays one level deep and the canvas, drag and drop and history keep working. A layout that needs more than columns of text is a section you write.

At publish, Smoodly checks that each row has one to six columns and that its spans add up to 12. An empty column is allowed; it is spacing.

Next, Marks and inline editing explains how the canvas knows what to make click-to-edit.

Edit this page on GitHubLast updated 6 Oct 2026