What is a Tag Specification?
Before compiling an HTML element, every compiler needs to know three basic facts: What is the tag name? What attributes or CSS classes should it possess? And where does the child content go?
In typical component frameworks, this is written inside JSX or HTML template strings. In declarative-spec, every tag is stored as a pure, serializable JSON node in spec.json.
The Tag Spec Structure
Each node in spec.json contains an immutable declarative shape:
- tag: The native HTML element name (
table,th,td,button). - attributes: Standard serializable attributes such as
class,data-role,type. - text / tokens: Placeholder tokens like
${columnName}that compilers replace with row data during table/card generation. - children: An array of initial nested child tag objects.
Blueprint Example
{
"buildHeader": {
"tag": "thead",
"attributes": {
"data-role": "headerRoot"
},
"children": []
},
"buildBodyCell": {
"tag": "td",
"attributes": {
"data-role": "bodyCell",
"class": "px-3 py-2 text-sm text-zinc-300"
},
"text": "${columnName}"
}
}