Varendo

Pagination

Stable cursor/page scope; loaded rows are not misrepresented as global selection.

FamilynavigationLicenseApache-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

Page two of four with previous and next controls enabled.

Interactive preview requires JavaScript.

View the complete example source
import {registerAeliqoElements} from "@varendo/web";
import {
  AeliqoBreadcrumbElement,
  AeliqoMenuElement,
  AeliqoPaginationElement,
  AeliqoTabsElement,
  AeliqoTreeNavElement,
  type AeliqoBreadcrumbItem,
  type AeliqoMenuItem,
  type AeliqoTabItem,
  type AeliqoTreeNavNode,
} from "@varendo/web/navigation";

const tabs: readonly AeliqoTabItem[] = [
  {id: "overview", label: "Overview", content: "Overview content"},
  {id: "details", label: "Details", content: "Details content"},
  {id: "history", label: "History", content: "History content", disabled: true},
];
const breadcrumb: readonly AeliqoBreadcrumbItem[] = [
  {id: "home", label: "Home", href: "/"},
  {id: "reports", label: "Reports", href: "/reports"},
  {id: "current", label: "Weekly report", current: true},
];
const menuItems: readonly AeliqoMenuItem[] = [
  {id: "open", label: "Open report"},
  {id: "archive", label: "Archive"},
  {id: "disabled", label: "Unavailable", disabled: true},
];
const treeNodes: readonly AeliqoTreeNavNode[] = [
  {id: "reports", label: "Reports", children: [{id: "weekly", label: "Weekly"}, {id: "monthly", label: "Monthly"}]},
  {id: "settings", label: "Settings", disabled: true},
];

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<AeliqoPaginationElement>("aeliqo-pagination", root);
		element.page = 2;
		element.pageCount = 4;
		element.hasPrevious = true;
		element.hasNext = true;
		element.label = "Report pages";
	}))(root);

Purpose

Shows the current page with previous and next controls from host-supplied data. Activation requests a page change; the component never fetches rows itself.

When to use it

When to use a different component

Properties and defaults

The host owns page data and applies the requested page after validating it.

Properties, ownership, and initial values
PropertyUse and ownershipDeclared typeInitial value
pageControls the current one-based page.number1
pageCountProvides the total known page count used to label and bound navigation.numberundefined
hasPreviousDeclares whether previous is available. The host updates it with the underlying data state.booleanfalse
hasNextDeclares whether next is available. The host updates it with the underlying data state.booleanfalse
labelProvides the visible label and accessible name for the component.string'Pagination'
pendingMarks an action as in progress and prevents repeated activation until the host clears it.booleanfalse

Events

Events, payloads, timing, and application responsibilities
EventPayloadEmittedApplication responsibility
aeliqo-page-changeThe requested one-based page.After previous, next, or a page control is activated.Load the authorized page and update controlled page and content.

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

Listen for aeliqo-page-change

TypeScript example
const element = document.querySelector('aeliqo-pagination');<p>element?.addEventListener('aeliqo-page-change', (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 current page and available directions are announced and page changes are emitted as requests.

Keyboard, focus, and accessibility

Keyboard behavior:

Exposed semantics:

Responsive behavior

Keep page controls large enough to operate. Let the host trim visible page links on narrow screens without hiding the current page.

Style hooks

Generated TypeScript declaration

View generated declaration
export declare class AeliqoPaginationElement extends AeliqoFoundationElement {
    static readonly properties: {
        page: {
            type: NumberConstructor;
        };
        pageCount: {
            type: NumberConstructor;
            attribute: string;
        };
        hasPrevious: {
            type: BooleanConstructor;
            attribute: string;
        };
        hasNext: {
            type: BooleanConstructor;
            attribute: string;
        };
        label: {
            type: StringConstructor;
        };
        pending: {
            type: BooleanConstructor;
            reflect: boolean;
        };
    };
    static readonly styles: import("lit").CSSResult[];
    page: number;
    pageCount?: number;
    hasPrevious: boolean;
    hasNext: boolean;
    label: string;
    pending: boolean;
    private normalizedPage;
    private normalizedPageCount;
    private move;
    protected render(): import("lit").TemplateResult<1>;
}

Version

This page documents the Varendo 0.6 component contract.