rw.setRootElement
Syntax
rw.setRootElement({
as: 'tagName', // HTML tag to use
class: 'classes', // CSS classes
args: { } // HTML attributes
});Parameters
Parameter
Type
Description
Basic Examples
Setting the Tag
const transformHook = (rw) => {
rw.setRootElement({
as: 'section'
});
};
exports.transformHook = transformHook;Adding Classes
Adding Attributes
Common Patterns
Dynamic Tag Based on Link
Custom HTML Tag from Properties
Container with Full Styling
Alpine.js Integration
Accordion/Disclosure Pattern
Notes
Last updated
Was this helpful?

