Varendo

Toast

Bounded transient feedback; essential errors remain persistently available elsewhere.

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 persistent success toast with an explicit dismiss button.

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<AeliqoToastElement>("aeliqo-toast", root);
		element.message = "Report saved";
		element.tone = "success";
		element.open = true;
		element.duration = 0;
		element.dismissible = true;
	}))(root);

Purpose

Transient feedback shown while open. Non-danger tones can dismiss on a timer or by request; danger tones remain open until dismissed. Keep important failures available in a persistent place too.

When to use it

When to use a different component

Properties and defaults

Keep essential information outside transient notifications; duration zero makes this fixture reviewable.

Properties, ownership, and initial values
PropertyUse and ownershipDeclared typeInitial value
openControls whether the overlay or expandable surface is currently open.booleanfalse
messageProvides the user-facing status, error, or recovery message.string''
toneSelects a semantic visual tone such as neutral, informative, success, warning, or danger.AeliqoFeedbackTone'info'
durationSets the visible toast duration in milliseconds. Use a persistent alert for information that must be acknowledged.number5000
dismissibleShows a user dismissal control. The host still removes or updates the message after the event.booleantrue

Events

Events, payloads, timing, and application responsibilities
EventPayloadEmittedApplication responsibility
aeliqo-toast-dismissThe dismissal reason for the current toast.After timeout or user dismissal.Remove the toast from application state.

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

Listen for aeliqo-toast-dismiss

TypeScript example
const element = document.querySelector('aeliqo-toast');<p>element?.addEventListener('aeliqo-toast-dismiss', (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 status is announced as transient feedback and can be dismissed by the user.

Set duration to zero for a notification that remains visible until the host or user dismisses it. Timed notifications are capped at 60 seconds; a danger tone never dismisses on the timer. Keep a durable status or error elsewhere if a user may need to read or act on it after the toast closes.

Keyboard, focus, and accessibility

Keyboard behavior:

Exposed semantics:

Responsive behavior

Allow long messages to wrap within the available width. Place transient feedback where it does not cover fixed task controls.

Style hooks

Generated TypeScript declaration

View generated declaration
export declare class AeliqoToastElement extends AeliqoFoundationElement {
    static readonly properties: {
        open: {
            type: BooleanConstructor;
            reflect: boolean;
        };
        message: {
            type: StringConstructor;
        };
        tone: {
            type: StringConstructor;
        };
        duration: {
            type: NumberConstructor;
        };
        dismissible: {
            type: BooleanConstructor;
        };
    };
    static readonly styles: import("lit").CSSResult[];
    open: boolean;
    message: string;
    tone: AeliqoFeedbackTone;
    duration: number;
    dismissible: boolean;
    private timer;
    protected updated(changed: Map<string, unknown>): void;
    disconnectedCallback(): void;
    private dismiss;
    protected render(): import("lit").TemplateResult<1>;
}

Version

This page documents the Varendo 0.6 component contract.