DOM classes produce static HTML strings, not live DOM nodes. Call
renderHTML() on the base DOM instance to finalize output with injected styles before returning from your plugin’s render() method.Why DOM helpers exist
FDO plugins execute in a sandboxed iframe context. Yourrender() method must return a single HTML string. The DOM helper classes give you:
- Type-safe element construction — no raw string concatenation needed
- Scoped CSS via goober — atomic class names generated from style objects, with no global leakage
- Automatic XSS escaping — all text content passed through
DOMTextis escaped before insertion - Consistent options API — every class accepts the same
optionsshape for classes, styles, and custom attributes
Shared options shape
Every DOM method that accepts anoptions parameter uses the following shape (inherited from DOM.DEFAULT_OPTIONS):
customAttributes field:
Base class: DOM
All helper classes extend the DOM base class. Key methods on DOM you will use directly:
| Method | Description |
|---|---|
createClassFromStyle(styleObj) | Generates a goober atomic class name from a CSS property map |
createStyleKeyframe(keyframe) | Generates a goober @keyframes animation class name |
renderHTML(element) | Wraps element HTML with extracted goober styles — call this as the final step in render() |
createElement(tag, props, ...children) | Low-level element factory used by all subclasses |
combineProperties(defaultClass, options, id?) | Merges classes and styles into a props object |
DOM class reference
DOMText
Inline and block text elements: headings, paragraphs, spans, code, labels, abbreviations, and more.
DOMButton
Button elements with click-handler attachment and full style control.
DOMTable
Full table hierarchy:
table, thead, tbody, tfoot, tr, th, td, and caption.DOMInput
Form inputs, textareas, and select dropdowns with
option and optgroup support.DOMMedia
Self-closing media elements:
img with src, alt, and extra attributes.DOMLink
Anchor elements with configurable
href, classes, and inline styles.Supporting classes (no dedicated reference page)
| Class | Elements generated | Typical use |
|---|---|---|
DOMSemantic | article, section, nav, header, footer, aside, main | Page-level layout |
DOMNested | div, ul, ol, li, dl, dt, dd, form, fieldset, legend | Composite layouts and forms |
DOMMisc | hr | Visual dividers |
Import paths
Minimal render example
DOMLink
DOMLink differs slightly from the other classes — you configure it at construction time rather than per-method call.