Link
Navigate to an application-approved destination; preserve browser open-in-new-tab behavior.
Use the web element directly without the semantic runtime.
A registered presentation adapter can bind this component to host-owned meaning and state.
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#
- Navigating to another page or route.
- Destinations users may open in a new tab.
- Links your app must approve before they render as anchors.
When to use a different component#
- Use Button when activation changes state or submits a request.
- Use Breadcrumb for a trail of ancestor links ending at the current page.
Properties and defaults#
The host supplies an approved href and target; arbitrary model URLs are not interpreted.
| Property | Use and ownership | Declared type | Initial value |
|---|---|---|---|
href | Provides an application-approved navigation destination. | string | '' |
target | Selects the approved browser navigation target. | AeliqoLinkTarget | '_self' |
label | Provides the visible label and accessible name for the component. | string | '' |
disabled | Prevents user interaction while keeping the control and its current value visible. | boolean | false |
Events#
| Event | Payload | Emitted | Application 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
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:
- ready
- disabled
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:
- Tab
- Enter
Exposed semantics:
- a
- aria-disabled
Responsive behavior#
The label follows inline text flow and can wrap. Avoid fixed-width wrappers that clip the text or focus outline.
Style hooks#
- Shadow parts:
link - Varendo design tokens referenced:
--aeliqo-color-accent,--aeliqo-color-info,--aeliqo-color-muted
Related components#
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.
