Home / Function/ renderHTMLElement() — astro Function Reference

renderHTMLElement() — astro Function Reference

Architecture documentation for the renderHTMLElement() function in dom.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  15d56d87_4e22_4427_af58_92aaeddf9a3b["renderHTMLElement()"]
  8ed07f65_b5eb_2959_672d_572dd370f3b4["dom.ts"]
  15d56d87_4e22_4427_af58_92aaeddf9a3b -->|defined in| 8ed07f65_b5eb_2959_672d_572dd370f3b4
  31069517_5643_3068_19ce_b72d5706a2c5["getHTMLElementName()"]
  15d56d87_4e22_4427_af58_92aaeddf9a3b -->|calls| 31069517_5643_3068_19ce_b72d5706a2c5
  style 15d56d87_4e22_4427_af58_92aaeddf9a3b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/dom.ts lines 10–27

export async function renderHTMLElement(
	result: SSRResult,
	constructor: typeof HTMLElement,
	props: any,
	slots: any,
): Promise<string> {
	const name = getHTMLElementName(constructor);

	let attrHTML = '';

	for (const attr in props) {
		attrHTML += ` ${attr}="${toAttributeString(await props[attr])}"`;
	}

	return markHTMLString(
		`<${name}${attrHTML}>${await renderSlotToString(result, slots?.default)}</${name}>`,
	);
}

Domain

Subdomains

Frequently Asked Questions

What does renderHTMLElement() do?
renderHTMLElement() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/dom.ts.
Where is renderHTMLElement() defined?
renderHTMLElement() is defined in packages/astro/src/runtime/server/render/dom.ts at line 10.
What does renderHTMLElement() call?
renderHTMLElement() calls 1 function(s): getHTMLElementName.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free