Varendo

Tooltip

Supplemental nonessential information; works on focus, dismisses, not the sole label.

FamilyfeedbackLicenseApache-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 focused report-details trigger with a short explanatory tooltip.

Interactive preview requires JavaScript.

View the complete example source
import {registerAeliqoElements} from "@varendo/web";
import {
  AeliqoAlertElement,
  AeliqoDialogElement,
  AeliqoDrawerElement,
  AeliqoEmptyStateElement,
  AeliqoPopoverElement,
  AeliqoProgressElement,
  AeliqoSkeletonElement,
  AeliqoToastElement,
  AeliqoTooltipElement,
} from "@varendo/web/feedback";



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<AeliqoTooltipElement>("aeliqo-tooltip", root);
		element.label = "More information";
		element.content = "Values are scoped to the current report.";
		element.open = true;
	}))(root);

Purpose

A short supplemental explanation shown when its built-in trigger gets focus or hover. Escape hides it; it never serves as the trigger's accessible name.

When to use it

When to use a different component

Properties and defaults

The label names the trigger; content supplements it and is not the only place to put essential meaning.

Properties, ownership, and initial values
PropertyUse and ownershipDeclared typeInitial value
labelProvides the visible label and accessible name for the component.string'More information'
contentProvides trusted plain content for the overlay. Do not pass untrusted HTML.string''
openControls whether the overlay or expandable surface is currently open.booleanfalse

Events

States and failure handling

Relevant states:

Expected result: The explanation appears on focus or hover without stealing focus from the trigger.

The built-in trigger opens the tooltip on focus or pointer hover and closes it on blur, pointer leave, or Escape. There is no disabled property and no separate component event. Remove the trigger when the explanation must be unavailable; setting open to false alone will not disable focus or hover. Keep a concise visible trigger label, because tooltip content is supplementary.

Keyboard, focus, and accessibility

Keyboard behavior:

Exposed semantics:

Responsive behavior

Keep essential instructions outside the tooltip. The trigger remains the layout anchor when the viewport is narrow or zoomed.

Style hooks

Generated TypeScript declaration

View generated declaration
export declare class AeliqoTooltipElement extends AeliqoFoundationElement {
    static readonly properties: {
        label: {
            type: StringConstructor;
        };
        content: {
            type: StringConstructor;
        };
        open: {
            type: BooleanConstructor;
            reflect: boolean;
        };
    };
    static readonly styles: import("lit").CSSResult[];
    label: string;
    content: string;
    open: boolean;
    private closeTimer;
    private show;
    private hide;
    private keydown;
    disconnectedCallback(): void;
    protected render(): import("lit").TemplateResult<1>;
}

Version

This page documents the Varendo 0.6 component contract.