Home / Function/ createLink() — astro Function Reference

createLink() — astro Function Reference

Architecture documentation for the createLink() function in overlay.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  18d2a16d_437c_2f03_6a56_47bf20f58c17["createLink()"]
  a932a37f_15f5_3203_d9bf_86f83ddbef01["ErrorOverlay"]
  18d2a16d_437c_2f03_6a56_47bf20f58c17 -->|defined in| a932a37f_15f5_3203_d9bf_86f83ddbef01
  7f32b908_586b_fc52_7198_82891a2fdf41["constructor()"]
  7f32b908_586b_fc52_7198_82891a2fdf41 -->|calls| 18d2a16d_437c_2f03_6a56_47bf20f58c17
  style 18d2a16d_437c_2f03_6a56_47bf20f58c17 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/errors/overlay.ts lines 773–787

	createLink(text: string, href: string | undefined): HTMLDivElement {
		const linkContainer = document.createElement('div');
		const linkElement = href ? document.createElement('a') : document.createElement('button');
		linkElement.innerHTML = text;

		if (href && linkElement instanceof HTMLAnchorElement) {
			linkElement.href = href;
			linkElement.target = '_blank';
		}

		linkContainer.appendChild(linkElement);
		linkContainer.className = 'link';

		return linkContainer;
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does createLink() do?
createLink() is a function in the astro codebase, defined in packages/astro/src/core/errors/overlay.ts.
Where is createLink() defined?
createLink() is defined in packages/astro/src/core/errors/overlay.ts at line 773.
What calls createLink()?
createLink() is called by 1 function(s): constructor.

Analyze Your Own Codebase

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

Try Supermodel Free