Developers · Sections and design

Sections and the design system

A NinjaHQ page is a list of sections. Each section type is a schema owned by the platform, so a page says what goes where but never how the HTML is written: headings get their level from their place, pictures need alt text, every layout works on a phone. This is the reference for list_section_types, add_section, update_section and set_design (page-builder 1.38.0).

The shape of a section

{
  "type": "hero",
  "variant": "split",
  "scheme": "dark",
  "show": "all",
  "settings": {
    "eyebrow": "Now enrolling",
    "heading": "Summer Ninja Camp",
    "text": "Obstacles, games and **coaches who love kids**.",
    "image": {
      "src": "/media/summer-camp.webp",
      "alt": "Kids cheer as a camper hits the buzzer",
      "focus": "50% 30%"
    }
  },
  "blocks": [
    {
      "settings": {
        "label": "Book camp",
        "href": "/camps"
      }
    }
  ]
}

variant is the layout (the first listed is the default), scheme the color scheme from the design, show all, phone or computer, hidden keeps it without showing it. A gym also has live data sections (data:<key>: the class schedule, competitions, coaches, camps and more) that draw live information; place them, but their content comes from the back office. list_section_types lists the ones a site has.

Section types

hero · Hero

Intro. Layouts: split, full, stacked, editorial, banner. Blocks: button, up to 3.

FieldKindLimit
eyebrowtext40 characters
heading requiredtext100 characters
texttext with **bold**, *italic*, links and lists500 characters
imagepicture { src, alt, focus }-
sizechoice: medium, short, tall-

text · Text

Content. Layouts: plain, centered, columns. Blocks: button, up to 4.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
text requiredtext with **bold**, *italic*, links and lists6000 characters

split · Picture and Text

Content. Layouts: image-left, image-right, overlap. Blocks: button, up to 2.

FieldKindLimit
eyebrowtext40 characters
heading requiredtext100 characters
texttext with **bold**, *italic*, links and lists2000 characters
image requiredpicture { src, alt, focus }-

columns · Columns

Content. Layouts: halves, wide-left, wide-right, thirds, narrow-left, narrow-right. Blocks: column, at least 1, up to 6. Columns side by side on computers, one under another on phones. Each column can hold a heading, text, a picture or a video, and buttons.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters
boxedyes or no-
centeryes or no-

cards · Cards

Content. Layouts: grid, list, compact, overlay, showcase. Blocks: card, at least 1, up to 24.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters
columnschoice: 3, 2, 4-

list · Icon List

Content. Layouts: plain, columns, boxes. Blocks: item, at least 1, up to 30.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters

stats · Numbers

Proof. Layouts: band, tiles. Blocks: stat, at least 1, up to 6.

FieldKindLimit
headingtext100 characters

quotes · Quotes

Proof. Layouts: grid, single, wall, carousel. Blocks: quote, at least 1, up to 24.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters

faq · Questions

Content. Layouts: accordion, columns, toggles. Blocks: qa, at least 1, up to 30.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters
openyes or no-

cta · Call to Action

Action. Layouts: band, card, split. Blocks: button, at least 1, up to 2.

FieldKindLimit
heading requiredtext100 characters
texttext with **bold**, *italic*, links and lists500 characters
imagepicture { src, alt, focus }-

Pictures. Layouts: grid, mosaic, strip. Blocks: image, at least 1, up to 24.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters
zoomyes or no-

logos · Logos

Proof. Layouts: row, grid. Blocks: logo, at least 1, up to 24.

FieldKindLimit
headingtext100 characters

steps · Steps

Content. Layouts: numbered, timeline. Blocks: step, at least 1, up to 10.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters

pricing · Pricing

Action. Layouts: cards, table. Blocks: plan, at least 1, up to 6.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
introtext with **bold**, *italic*, links and lists600 characters

video · Video

Pictures. Layouts: wide, video-left, video-right. Blocks: button, up to 2. A video you upload, played from your own website, or a YouTube video. Nothing plays or loads until a visitor presses play; the poster is a picture from your own library.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters
texttext with **bold**, *italic*, links and lists2000 characters
filea video from the site's own library-
videoYouTube link or id-
title requiredtext100 characters
posterpicture { src, alt, focus }-

jump · Jump Links

Intro. Layouts: buttons, bar. Blocks: button, at least 1, up to 10. Buttons that jump to sections further down this page. Give each section an Anchor in its settings (like parties), then link to it as #parties.

FieldKindLimit
eyebrowtext40 characters
headingtext100 characters

shared · Shared Sections

Reusable. Layouts: default. Shows the sections of one of your Shared Sections pages here. Change them on that page and every page that shows them changes too.

FieldKindLimit
pagetext80 characters

Blocks

The repeatable items inside a section, sent as blocks: [{ settings: { … } }] in order.

button · Button

FieldKindLimit
label requiredtext40 characters
href requiredlink-
stylechoice: primary, secondary-

card · Card

FieldKindLimit
title requiredtext80 characters
texttext with **bold**, *italic*, links and lists600 characters
imagepicture { src, alt, focus }-
iconchoice: check, clock, pin, phone, mail, calendar, star, heart, info, trophy, people, arrow, cart, card, gift-
badgetext24 characters
pricetext24 characters
hreflink-
labeltext40 characters
href2link-
label2text40 characters
hovertext160 characters
wholeyes or no-

stat · Number

FieldKindLimit
value requiredtext12 characters
label requiredtext60 characters

quote · Quote

FieldKindLimit
text requiredtext with **bold**, *italic*, links and lists600 characters
name requiredtext60 characters
roletext80 characters
starschoice: 5, 4, 3, 2, 1-

qa · Question

FieldKindLimit
q requiredtext160 characters
a requiredtext with **bold**, *italic*, links and lists6000 characters
videoYouTube link or id-
filea video from the site's own library-
labeltext40 characters
hreflink-

column · Column

FieldKindLimit
headingtext100 characters
texttext with **bold**, *italic*, links and lists4000 characters
imagepicture { src, alt, focus }-
videoYouTube link or id-
filea video from the site's own library-
titletext100 characters
labeltext40 characters
hreflink-
label2text40 characters
href2link-
picLinkyes or no-

item · Line

FieldKindLimit
iconchoice: check, clock, pin, phone, mail, calendar, star, heart, info, trophy, people, arrow, cart, card, gift, number-
text requiredtext with **bold**, *italic*, links and lists400 characters

image · Picture

FieldKindLimit
image requiredpicture { src, alt, focus }-
captiontext140 characters
FieldKindLimit
image requiredpicture { src, alt, focus }-
hreflink-

step · Step

FieldKindLimit
title requiredtext80 characters
texttext with **bold**, *italic*, links and lists600 characters
whentext30 characters

plan · Plan

FieldKindLimit
name requiredtext60 characters
price requiredtext24 characters
pertext24 characters
texttext with **bold**, *italic*, links and lists800 characters
hreflink-
labeltext40 characters
featuredyes or no-

The design system

A design starts from a personality and changes what it likes with set_design { personality, changes }. Every color pair is checked for WCAG AA contrast, and a pair that fails is refused with the reason. get_design_system returns the site's design, its own extra color roles and fonts.

TokenChoices
personalitybold-athletic (Bold Athletic), clean-studio (Clean Studio), playful-kids (Playful Kids), editorial (Editorial), premium-dark (Premium Dark), retro-gym (Retro Gym); the default is clean-studio
schemeslight, dark, accent, each with the roles bg, surface, text, muted, accent, accentText, border as #rrggbb
fonts{ heading, body }: poppins (Poppins (geometric sans)), system (System sans), humanist (Humanist sans), rounded (Rounded sans), condensed (Condensed sans), serif (Classic serif), didone (High-contrast serif), slab (Slab serif), mono (Monospace), plus the fonts every NinjaHQ site serves itself (Poppins, Barlow, Raleway, Montserrat, Saira Condensed)
radiussharp, soft, round
buttonssolid, outline, pill, underline
cardsflat, outlined, raised, tinted
photossquare, rounded, arch
dividersnone, angle, wave, curve
spacingcompact, normal, airy
widthnarrow, normal, wide, full
headingCasenone, upper
motionnone, subtle
scale, base, headingWeight, radiusPxnumbers: the type scale, base size in pixels, heading weight, an exact corner size
{
  "personality": "bold-athletic",
  "changes": {
    "radius": "round",
    "buttons": "pill",
    "schemes": {
      "light": {
        "accent": "#1d4ed8",
        "accentText": "#ffffff"
      }
    }
  },
  "dry_run": true
}

Custom CSS

  • Whole site: set_design { custom_css }, up to 60,000 characters, applied after the design's tokens. It replaces the site's CSS, so read it with get_design_system first.
  • One page: update_page { css }, up to 20,000 characters, scoped for you: .pb-t-hero h1 becomes [data-pb-page="/camps"] .pb-t-hero h1; & or :scope is the page.
  • Hooks: the design's variables (var(--pb-accent), var(--pb-font-h), …) and classes .pb, .pb-sec, .pb-t-<type>, .pb-v-<layout>, .pb-s-<scheme>, .pb-btn-1.
  • Rules: Plain CSS only: no @import, @charset or @namespace; no < or backslashes; url() only for the site's own files under /media/ and /fonts/ (nothing from other websites); nothing that runs code (expression(), javascript:, behavior, -moz-binding); no image-set() or element(); braces must balance and comments must be closed.
  • No JavaScript and no raw HTML. Sites run no custom scripts and load nothing from other companies.

Ask NinjaHQ

Answers from our Help Center and website

Ask anything about NinjaHQ, or try:

AI answers from NinjaHQ's own pages and can make mistakes. Your questions are sent to Anthropic, the AI company, to answer; NinjaHQ doesn't keep them. Privacy