Home / Function/ element() — svelte Function Reference

element() — svelte Function Reference

Architecture documentation for the element() function in index.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  19380edd_f640_caf7_1043_c5632838a14e["element()"]
  1c4bc493_24af_177e_7307_a999997aceac["index.js"]
  19380edd_f640_caf7_1043_c5632838a14e -->|defined in| 1c4bc493_24af_177e_7307_a999997aceac
  6f1eae94_35bd_e5bc_d962_31f3ce608951["push()"]
  19380edd_f640_caf7_1043_c5632838a14e -->|calls| 6f1eae94_35bd_e5bc_d962_31f3ce608951
  02a8b5a2_13c5_e5b3_1ed2_617763d0904d["is_void()"]
  19380edd_f640_caf7_1043_c5632838a14e -->|calls| 02a8b5a2_13c5_e5b3_1ed2_617763d0904d
  1f8b4192_1e2b_e1e2_0124_82f532b0751c["is_raw_text_element()"]
  19380edd_f640_caf7_1043_c5632838a14e -->|calls| 1f8b4192_1e2b_e1e2_0124_82f532b0751c
  style 19380edd_f640_caf7_1043_c5632838a14e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/server/index.js lines 34–52

export function element(renderer, tag, attributes_fn = noop, children_fn = noop) {
	renderer.push('<!---->');

	if (tag) {
		renderer.push(`<${tag}`);
		attributes_fn();
		renderer.push(`>`);

		if (!is_void(tag)) {
			children_fn();
			if (!is_raw_text_element(tag)) {
				renderer.push(EMPTY_COMMENT);
			}
			renderer.push(`</${tag}>`);
		}
	}

	renderer.push('<!---->');
}

Domain

Subdomains

Frequently Asked Questions

What does element() do?
element() is a function in the svelte codebase, defined in packages/svelte/src/internal/server/index.js.
Where is element() defined?
element() is defined in packages/svelte/src/internal/server/index.js at line 34.
What does element() call?
element() calls 3 function(s): is_raw_text_element, is_void, push.

Analyze Your Own Codebase

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

Try Supermodel Free