Skip to main content

Configuration Schema

This document provides a complete reference for the XBuilder popup configuration schema. Use this when working with exported JSON or programmatically creating popups.

Top-Level Structure​

{
"id": "string",
"isOpen": "boolean",
"position": "string",
"backgroundType": "string",
"backgroundColor": "string",
"contentType": "string",
"elements": [],
"trigger": "string",
// ... more properties
}

Core Properties​

Identification​

PropertyTypeDescription
idstringUnique popup identifier
isOpenbooleanWhether popup is currently open

Position​

PropertyTypeValuesDescription
positionstringcenter, top-left, top-center, top-right, middle-left, middle-center, middle-right, bottom-left, bottom-center, bottom-rightPopup position on screen

Dimensions​

PropertyTypeExampleDescription
widthstring"500px", "90%"Popup width
heightstring"auto", "400px"Popup height
maxWidthstring"600px"Maximum width
maxHeightstring"80vh"Maximum height
minWidthstring"300px"Minimum width
minHeightstring"200px"Minimum height

Background​

PropertyTypeValuesDescription
backgroundTypestringsolid, gradient, imageBackground type
backgroundColorstring"#ffffff"Solid background color
backgroundImagestringURLBackground image URL

Gradient Object​

{
"gradient": {
"type": "linear",
"direction": "180deg",
"colors": [
{ "color": "#667eea", "position": 0 },
{ "color": "#764ba2", "position": 100 }
]
}
}

Border & Shadow​

PropertyTypeDescription
borderRadiusstringCorner radius ("16px")
borderWidthstringBorder width
borderColorstringBorder color
borderStylestringsolid, dashed, dotted

Box Shadow Object​

{
"boxShadow": {
"x": "0px",
"y": "4px",
"blur": "20px",
"spread": "0px",
"color": "rgba(0,0,0,0.15)"
}
}

Content​

PropertyTypeDescription
contentTypestringelements (always for visual builder)
elementsarrayArray of element objects

Overlay​

PropertyTypeDescription
overlayColorstringOverlay background color
overlayOpacitynumberOpacity 0-1
overlayBlurstringBackdrop blur amount
closeOnOverlayClickbooleanClose when clicking overlay

Close Button​

PropertyTypeDescription
showCloseButtonbooleanShow/hide close button
closeButtonPositionstringinside-top-right, outside-top-right
closeButtonSizestringButton size
closeButtonColorstringIcon color

Animation​

PropertyTypeDescription
animationstringEntry animation name
exitAnimationstringExit animation name
animationDurationstringAnimation duration ("300ms")

Trigger Properties​

PropertyTypeValuesDescription
triggerstringonload, onclick, onscroll, onexit, timed, floatingbuttonTrigger type
triggerDelaynumberMillisecondsDelay before showing
triggerScrollnumber0-100Scroll percentage
triggerSelectorstringCSS selectorClick trigger selector
PropertyTypeDescription
cookieTypenumberCookie type identifier
cookieDurationnumberDays until cookie expires
cookieSetTimingstringafterClose, afterDisplay
testModebooleanIgnore cookies when true

Element Schema​

Each element in the elements array follows this structure:

{
"id": "string",
"type": "string",
"order": "number",
"content": {},
"style": {},
"advanced": {},
"children": []
}

Element Identification​

PropertyTypeDescription
idstringUnique element ID
typestringElement type
ordernumberDisplay order

Element Types​

TypeDescription
textText paragraph
headingHeading (h1-h6)
buttonClickable button
imageImage display
videoVideo embed
iconFont Awesome icon
dividerHorizontal line
spacerEmpty space
mapsGoogle Maps embed
iframeExternal iframe
sectionRow container
columnColumn container

Content Object​

Content varies by element type:

Text/Heading​

{
"content": {
"text": "Your text here",
"alignment": "center"
}
}

Button​

{
"content": {
"text": "Click Me",
"link": "https://example.com",
"target": "_blank",
"action": "link"
}
}

Image​

{
"content": {
"src": "https://example.com/image.jpg",
"alt": "Image description",
"link": "",
"width": "100%",
"height": "auto"
}
}

Video​

{
"content": {
"videoLink": "https://youtube.com/watch?v=...",
"autoplay": false,
"muted": false,
"loop": false,
"controls": true
}
}

Style Object​

{
"style": {
"typography": {
"fontFamily": "Inter",
"fontSize": "16px",
"fontWeight": "400",
"lineHeight": "1.6",
"letterSpacing": "0",
"color": "#1e293b"
},
"spacing": {
"margin": {
"top": "0px",
"right": "0px",
"bottom": "16px",
"left": "0px"
},
"padding": {
"top": "0px",
"right": "0px",
"bottom": "0px",
"left": "0px"
}
},
"background": {
"type": "solid",
"color": "transparent"
},
"border": {
"width": "0px",
"style": "solid",
"color": "#e2e8f0",
"radius": {
"topLeft": "0px",
"topRight": "0px",
"bottomRight": "0px",
"bottomLeft": "0px"
}
}
}
}

Advanced Object​

{
"advanced": {
"htmlId": "my-element",
"cssClasses": "custom-class another-class",
"hideOnDesktop": false,
"hideOnTablet": false,
"hideOnMobile": false
}
}

Children (Sections/Columns)​

Sections contain columns, columns contain elements:

{
"type": "section",
"children": [
{
"type": "column",
"content": {
"columnWidth": "50%"
},
"children": [
{ "type": "heading", ... },
{ "type": "text", ... }
]
},
{
"type": "column",
"content": {
"columnWidth": "50%"
},
"children": [
{ "type": "image", ... }
]
}
]
}

Device-Specific Values​

Many properties support device-specific values:

{
"fontSize": {
"desktop": "18px",
"tablet": "16px",
"mobile": "15px"
}
}

Or as a simple value (applies to all devices):

{
"fontSize": "16px"
}

Complete Example​

{
"id": "popup-123456789",
"isOpen": true,
"position": "center",
"width": "500px",
"backgroundType": "solid",
"backgroundColor": "#ffffff",
"borderRadius": "16px",
"boxShadow": {
"x": "0px",
"y": "10px",
"blur": "40px",
"spread": "0px",
"color": "rgba(0,0,0,0.2)"
},
"animation": "fadeIn",
"trigger": "onload",
"contentType": "elements",
"elements": [
{
"id": "heading-1",
"type": "heading",
"order": 0,
"content": {
"text": "Welcome!",
"level": "h2",
"alignment": "center"
},
"style": {
"typography": {
"fontSize": "32px",
"fontWeight": "700",
"color": "#1e293b"
}
}
},
{
"id": "button-1",
"type": "button",
"order": 1,
"content": {
"text": "Get Started",
"link": "/signup",
"target": "_self"
},
"style": {
"background": {
"type": "solid",
"color": "#4F46E5"
},
"typography": {
"color": "#ffffff"
}
}
}
]
}

Validation​

When importing JSON:

  • Required fields must be present
  • Types must match schema
  • IDs must be unique
  • Nested structures must be valid