Cyber Week30% off Lifetime with code CYBER — it will never be this cheap againUntil 28 Nov, 10:00 CET

Building

Elements

Every element you can insert, what it is for, and the layout rules that keep a page sane.

Everything on a page is an element, and every element carries builder-data-element naming what it is. That attribute is what the design system styles, what the insert menu groups, and what the panels read — it is never a class you have to keep in sync.

Layout

ElementTagWhat it is for
SectionsectionA full-width band. Carries the site padding.
ContainerdivA width and a rhythm: max-inline-size: var(--content-width), centered, --container-spacing between its blocks.
Flex DivdivA row of children, wrapping by default, --content-spacing apart.
DivdivA plain block. Set it to flex or grid and its children are already --content-spacing apart — a grid is a Div.
FigurefigureAn image and its caption.
Loop—Repeats its children over a query. Emits no wrapper.
Condition—Decides whether its children ship at all. Emits no wrapper.
Main and Page contentmain, —Templates only, and they arrive with the template: the page’s <main>, and inside it the slot the page is rendered into. Neither can be deleted or duplicated; both can be moved.

The site padding is the Section's

A section is the band that touches both edges of the viewport, so it is the only element that knows where the edge is. Once it carries the site padding, everything inside it is clear of the edge — whether or not it sits in a container.

A container is a width and a rhythm, and nothing else. Put page padding on it and two nested containers pay the site padding twice, while a heading dropped straight into a section runs into the screen.

Loop and Condition are logic, not markup

Neither emits a tag. A Loop emits Astro's .map(); a Condition emits a guard or nothing at all. They have no box, no classes and nothing to style — put a Div inside (or around) one when you want a box. See Loops & conditions.

Content

ElementTagNotes
Headingh2Change the level in the Settings tab. Sizes come from --h1 … --h6.
TextpParagraph.
Rich textdivFormatted text — headings, paragraphs, lists, pictures — usually bound to a Long text field.
SpanspanInline, for a word that needs its own color.
LinkaAn href, and anything you like inside.
ButtonbuttonArrives as .btn.btn--primary. See Buttons.
ImageimgArrives wrapped in a figure, and responsive: Astro resizes it into a srcset when the site is built. See Media.
Videovideo / iframeA file, or a YouTube or Vimeo link — the element becomes the right tag. Arrives muted, autoplaying and looping.
IconsvgAn icon picked from an installed set, as inline SVG — as big as the text and in its color.
SVGsvgOwns its own markup; paste a path or a whole icon.
Listulul or ol, with li children.

Navigation

Fifteen more elements make up a menu — nav, nav-list, nav-item, nav-link, nav-dropdown, nav-trigger, nav-caret, nav-sub, nav-mega, nav-panel, nav-toggle, nav-burger, nav-close, nav-scrim, nav-skip. Inserting Nav composes the whole assembled menu out of them; the rest are there so you can add a single link or a second dropdown to one you already have.

What a menu looks like comes from the design system’s Navigation module, at zero specificity — so a bare menu looks like a menu, and a class you put on a part (.site-header__link) is the whole of restyling it. See Navigation.

Inserting

in the top bar, or ⌘E. It is one list — layout, content, navigation, the groups for forms, the carousel, pop-ups and any social feeds you set up, then your own components — with a search field, because by the tenth element you know its name.

The insert dialog: a search field above Section, Container, Flex Div, Div, Figure, Loop, Condition, Code, Heading, Text, Rich text, Span, Link, Button and Image.
Enter puts the element inside the selection; ⌘Enter puts it next to it.

Paste HTML takes real markup and turns it into elements, so a snippet from a codepen or a block of markup from a designer arrives as a tree you can edit rather than a black box.

Copy and paste works between projects too: an element pasted from another sitereal project brings the components, variables and pictures it uses, and offers to bring the pop-ups its buttons open. What this project already has keeps its own answer.

On an entry page, or inside a Loop over a collection, Fields sits beside the insert button. It lists the fields of the entry and inserts the element that shows each one, already bound — a Heading for the title, Rich text for a long text, an Image for a picture, a Loop of images for a gallery.

Wrapping

Select an element and wrap it in a Div, Container, Section, Link or Span — or in a Loop or Condition, which add no markup and change what happens to what is inside.

Names and classes

Rename anything in the tree. The name is what the layer list shows and what Generate BEM classes builds on (right-click a layer):

Pricing table       →  .pricing-table
  Item              →  .pricing-table__item
  Item              →  .pricing-table__item-2
  Price             →  .pricing-table__price

One meaningful class per node, and the first class is the element's selector — that is the rule the Style and CSS panels write to. A variation is a modifier alongside the block class (.pricing-table--compact), never instead of it.