Varendo

Link

Navigate to an application-approved destination; preserve browser open-in-new-tab behavior.

FamilyfoundationLicenseApache-2.0
StandaloneAvailable

Use the web element directly without the semantic runtime.

Semantic bindingAvailable

A registered presentation adapter can bind this component to host-owned meaning and state.

Automatic adaptationNo standard recipe

The standard recipe resolver does not select this component automatically.

Import and live example

One application-resolved same-origin report destination.

Interactive preview requires JavaScript.

View the complete example source
import {registerAeliqoElements} from "@varendo/web";
import {
  AeliqoAvatarElement,
  AeliqoBadgeElement,
  AeliqoButtonElement,
  AeliqoGridElement,
  AeliqoHeadingElement,
  AeliqoIconButtonElement,
  AeliqoLinkElement,
  AeliqoScrollAreaElement,
  AeliqoSeparatorElement,
  AeliqoSplitPaneElement,
  AeliqoStackElement,
  AeliqoSurfaceElement,
  AeliqoTextElement,
} from "@varendo/web/foundation";



registerAeliqoElements();

const host = document.querySelector<HTMLElement>("#aeliqo-example") ?? (() => {
  const created = document.createElement("div");
  created.id = "aeliqo-example";
  (document.body ?? document.documentElement).append(created);
  return created;
})();

function createCatalogRoot(container: HTMLElement): HTMLElement {
  const root = document.createElement("div");
  root.dataset.catalogSourceRoot = "true";
  root.style.display = "grid";
  root.style.gap = "12px";
  container.append(root);
  return root;
}

function createCatalogElement<T extends HTMLElement>(tagName: string, container: HTMLElement): T {
  const element = document.createElement(tagName) as T;
  element.setAttribute("data-aeliqo-theme", "light");
  container.append(element);
  return element;
}

function appendSlottedText(root: HTMLElement, slot: string, textContent: string): void {
  const content = document.createElement("span");
  content.slot = slot;
  content.textContent = textContent;
  root.append(content);
}

const root = createCatalogRoot(host);
(((root) => {
		const element = createCatalogElement<AeliqoLinkElement>("aeliqo-link", root);
		element.label = "View report";
		element.href = "/reports/weekly";
		element.target = "_self";
	}))(root);

Purpose

A native link to a destination your app approves, preserving browser behavior like open-in-new-tab. The host sets href and target; a cancellable event lets it intercept activation.

When to use it

When to use a different component

Properties and defaults

The host supplies an approved href and target; arbitrary model URLs are not interpreted.

Properties, ownership, and initial values
PropertyUse and ownershipDeclared typeInitial value
hrefProvides an application-approved navigation destination.string''
targetSelects the approved browser navigation target.AeliqoLinkTarget'_self'
labelProvides the visible label and accessible name for the component.string''
disabledPrevents user interaction while keeping the control and its current value visible.booleanfalse

Events

Events, payloads, timing, and application responsibilities
EventPayloadEmittedApplication responsibility
aeliqo-link{source, target, modified?}Before component-managed navigation.Apply routing and authorization while preserving browser modifier behavior.

Events cross the component boundary as user proposals. Validate their detail and current authority before applying a business effect.

Listen for aeliqo-link

TypeScript example
const element = document.querySelector('aeliqo-link');<p>element?.addEventListener('aeliqo-link', (event) => {
  const proposal = (event as CustomEvent<unknown>).detail;
  // Validate the proposal, update host state, then assign controlled properties.
  applyProposal(proposal);
});

States and failure handling

Relevant states:

Expected result: The approved link is navigable and emits a cancellable link proposal.

An empty or invalid href renders plain text, not an anchor. disabled renders noninteractive text too. Approved _blank destinations get noopener noreferrer; your app still decides which destinations users may open.

Keyboard, focus, and accessibility

Keyboard behavior:

Exposed semantics:

Responsive behavior

The label follows inline text flow and can wrap. Avoid fixed-width wrappers that clip the text or focus outline.

Style hooks

Generated TypeScript declaration

View generated declaration
export declare class AeliqoLinkElement extends AeliqoFoundationElement {
    static readonly properties: {
        href: {
            type: StringConstructor;
        };
        target: {
            type: StringConstructor;
        };
        label: {
            type: StringConstructor;
        };
        disabled: {
            type: BooleanConstructor;
            reflect: boolean;
        };
    };
    href: string;
    target: AeliqoLinkTarget;
    label: string;
    disabled: boolean;
    protected render(): import("lit").TemplateResult<1>;
    private readonly handleClick;
    static readonly styles: import("lit").CSSResult[];
}

Version

This page documents the Varendo 0.6 component contract.