This page describes the structure of the JSON output produced by renderToJSON() and the AST returned by parse().
{
"type": "document",
"version": "0.1",
"meta": {
"title": "Document Title",
"viewport": "desktop"
},
"children": [...]
}{
"type": "component-type",
"props": {
"key": "value",
"classes": ["class1", "class2"],
"state": "state-name"
},
"children": [...],
"content": "text content",
"position": {
"start": { "line": 1, "column": 1 },
"end": { "line": 1, "column": 10 }
}
}Layout:
container(generic)herocardmodalsidebarnavfootergridsection
Form:
buttoninputtextareaselectcheckboxradioform
Content:
headingparagraphtextimageiconlisttable
UI:
tabsaccordionbreadcrumbsalertbadge
State:
loadingempty-stateerror-state
Input:
## Contact Us
Name
[_____________________________]{required}
Email
[_____________________________]{type:email required}
[Submit]*Output (JSON):
{
"type": "section",
"children": [
{
"type": "heading",
"level": 2,
"content": "Contact Us"
},
{
"type": "paragraph",
"content": "Name"
},
{
"type": "input",
"props": {
"type": "text",
"required": true
}
},
{
"type": "paragraph",
"content": "Email"
},
{
"type": "input",
"props": {
"type": "email",
"required": true
}
},
{
"type": "button",
"props": {
"variant": "primary"
},
"content": "Submit"
}
]
}Input:
[[ :logo: MyApp | Home | Products | [Sign In] ]]{.nav}Output (JSON):
{
"type": "nav",
"props": {
"classes": ["nav"]
},
"children": [
{
"type": "brand",
"children": [
{ "type": "icon", "props": { "name": "logo" } },
{ "type": "text", "content": "MyApp" }
]
},
{ "type": "nav-item", "content": "Home" },
{ "type": "nav-item", "content": "Products" },
{
"type": "button",
"content": "Sign In"
}
]
}Input:
::: grid-3 card
### :rocket: Fast
Quick rendering
### :shield: Secure
Enterprise security
### :zap: Powerful
Advanced features
:::Output (JSON):
{
"type": "section",
"props": {
"classes": ["grid-3"]
},
"children": [
{
"type": "heading",
"level": 2,
"content": "Features"
},
{
"type": "grid",
"props": { "columns": 3 },
"children": [
{
"type": "grid-item",
"children": [
{
"type": "heading",
"level": 3,
"children": [
{ "type": "icon", "props": { "name": "rocket" } },
{ "type": "text", "content": " Fast" }
]
},
{
"type": "paragraph",
"content": "Quick rendering"
}
]
},
// ... more items
]
}
]
}