Assembler
A DOM assembler for creating HTML fragments from templates and structured configuration.
import { Assembler } from "@schukai/monster/source/dom/assembler.mjs";Assembler is the low-level DOM construction helper behind Monster templating flows. Use it when you already have a prepared DocumentFragment and want to clone it repeatedly while keeping the assembly rules under your control.
It is most useful in infrastructure code, custom rendering helpers and framework bridges. For normal application markup, prefer the higher-level template and updater layers instead of manually assembling nodes.
Basic Assembly Flow
import { Assembler } from "@schukai/monster/source/dom/assembler.mjs";
const template = document.getElementById("card-template");
const target = document.getElementById("assembler-result");
const assembler = new Assembler(template.content);
target.append(assembler.createDocumentFragment());Assembler Result
This fragment was cloned from a template.
Exported
ATTRIBUTEPREFIX, AssemblerDerived from
BaseOptions
The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the Base.
Properties
The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the Base.
Methods
The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the Base.
Constructor
constructor(fragment)fragment{documentfragment}: fragment
{TypeError}value is not an instance of{TypeError}value is not a function{Error}the function is not defined
Behavioral methods
createDocumentFragment(data)data{proxyobserver|undefined}: data
- {DocumentFragment}
{TypeError}value is not an instance of
Structural methods
getAttributePrefix()- {string}
setAttributePrefix(prefix)prefix{string}: prefix
- {Assembler}
{TypeError}value is not a string
Events
This component does not fire any public events. It may fire events that are inherited from its parent classes.