Skip to main content

Section Definitions

Section definitions are the component library — reusable types that templates reference.

Creating a Definition

POST /api/v1/admin/sdui/section-definitions
{
"type": "HeroSection",
"name": "Hero Section",
"description": "Full-width hero banner with CTA buttons",
"category": "layout",
"platforms": "ALL",
"maxBlocks": 3,
"settings": [
{
"id": "title",
"type": "TEXT",
"label": "Title",
"defaultValue": "Welcome"
},
{
"id": "bgColor",
"type": "COLOR",
"label": "Background Color",
"defaultValue": "#FFFFFF"
},
{
"id": "bgImage",
"type": "IMAGE",
"label": "Background Image"
}
],
"blocks": [
{
"type": "Button",
"name": "CTA Button",
"limit": 2,
"settings": [
{
"id": "label",
"type": "TEXT",
"label": "Label",
"defaultValue": "Click Me"
},
{
"id": "variant",
"type": "SELECT",
"label": "Style",
"defaultValue": "primary",
"options": [
{ "value": "primary", "label": "Primary" },
{ "value": "secondary", "label": "Secondary" }
]
}
]
}
]
}

Setting Types

TypeDescriptionExample
TEXTSingle-line textTitle, label
TEXTAREAMulti-line textDescription
RICHTEXTHTML contentBody text
NUMBERInteger/decimalColumn count
RANGESliderOpacity
CHECKBOXBoolean toggleShow/hide
SELECTDropdownStyle variant
COLORColor picker#1a1a2e
IMAGEImage URLBanner image
VIDEOVideo URLBackground video
URLLink URLCTA link
HTMLRaw HTMLEmbed code

Setting Constraints

Settings can have constraints depending on their type:

FieldApplicable TypesDescription
defaultValueAllDefault when template doesn't override
placeholderTEXT, TEXTAREA, URLPlaceholder text
infoAllHelp tooltip in admin UI
min / maxNUMBER, RANGENumeric bounds
stepNUMBER, RANGEIncrement step
unitNUMBER, RANGEDisplay unit (px, %, em)
optionsSELECTDropdown options: [{ value, label, group }]

Block Schemas

Blocks are child components within a section. Each block schema defines:

{
"type": "Button",
"name": "CTA Button",
"limit": 2,
"settings": [
{ "id": "label", "type": "TEXT", "defaultValue": "Click Me" },
{ "id": "url", "type": "URL" },
{ "id": "variant", "type": "SELECT", "options": [
{ "value": "primary", "label": "Primary" },
{ "value": "secondary", "label": "Secondary" }
]}
]
}
  • limit: max number of this block type in one section (0 = unlimited)
  • Each block type has its own settings with defaults
  • Block settings are merged the same way as section settings

Presets

Presets are pre-configured section templates for quick creation in the admin UI:

{
"presets": [
{
"name": "Hero with CTA",
"settings": { "title": "Welcome", "bgColor": "#1a1a2e" },
"blocks": [
{ "type": "Button", "settings": { "label": "Explore", "variant": "primary" } }
]
},
{
"name": "Hero minimal",
"settings": { "title": "Welcome" },
"blocks": []
}
]
}

When an admin selects a preset, the section is pre-filled with those settings and blocks. They can then customize further.

Definition Status

StatusMeaning
ACTIVEAvailable for use in templates. Rendered at runtime.
DRAFTWork in progress. Not available in template editor dropdown.
DEPRECATEDStill renders in existing templates, but hidden from new template creation.

Full Field Reference

SectionDef

FieldTypeRequiredDescription
typestringYesUnique identifier (e.g., HeroSection)
namestringYesDisplay name
descriptionstringNoHuman-readable description
categorystringNoGrouping in admin UI (e.g., layout, content)
iconstringNoIcon identifier or URL
platformsstringNoALL, WEB, MOBILE, TABLET (default: ALL)
tagstringNoMetadata tag
maxBlocksintNoMax child blocks (0 = unlimited)
settingsSettingDefinition[]NoConfigurable settings with defaults
blocksBlockSchema[]NoAllowed child block types
presetsPreset[]NoPre-configured templates
statusstringNoACTIVE, DRAFT, DEPRECATED (default: ACTIVE)