SelectionSummary
Disclose selected identities or server predicate scope; never imply unobserved global selection.
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#
Two selected people with a visible clear-selection action.
Interactive preview requires JavaScript.
View the complete example source
import {registerAeliqoElements} from "@varendo/web";
import {
AeliqoCardCollectionElement,
AeliqoDeltaElement,
AeliqoDetailElement,
AeliqoFilterBuilderElement,
AeliqoKeyValueElement,
AeliqoMetricElement,
AeliqoRecordListElement,
AeliqoSelectionSummaryElement,
AeliqoTableElement,
type AeliqoKeyValueItem,
type AeliqoTableColumn,
type AeliqoTableRow,
} from "@varendo/web/data";
import type {ResultRef,
Scalar,
} from "@varendo/core";
import type {AeliqoDataColumn, AeliqoDataScope, AeliqoFieldOption} from "@varendo/web/data";
const catalogRef: ResultRef = {
id: "aeliqo-catalog-example",
revision: "1",
outputId: "people",
queryDigest: "catalog-query",
scopeDigest: "catalog-scope",
};
const catalogRows: readonly Readonly<Record<string, Scalar>>[] = [
{id: "ada", name: "Ada Lovelace", team: "Research", date: "2026-09-08", amount: 120},
{id: "lin", name: "Lin Chen", team: "Product", date: "2026-09-09", amount: 96},
{id: "grace", name: "Grace Hopper", team: "Research", date: "2026-09-10", amount: 144},
];
const catalogColumns: readonly AeliqoDataColumn[] = [
{key: "id", label: "ID", type: "text", sortable: true},
{key: "name", label: "Name", type: "text", sortable: true},
{key: "team", label: "Team", type: "text"},
{key: "date", label: "Date", type: "date", sortable: true},
{key: "amount", label: "Amount", type: "integer", align: "end"},
];
const catalogFields: readonly AeliqoFieldOption[] = [
{id: "name", label: "Name", type: "text"},
{id: "team", label: "Team", type: "text"},
{id: "amount", label: "Amount", type: "integer"},
];
const catalogScope: AeliqoDataScope = {
loaded: catalogRows.length,
filteredTotal: catalogRows.length,
populationDigest: catalogRef.scopeDigest,
kind: "filtered",
label: "Authorized people",
};
const tableColumns: readonly AeliqoTableColumn[] = catalogColumns.map(({key, label, sortable, align}) => ({key, label, ...(sortable === undefined ? {} : {sortable}), ...(align === undefined ? {} : {align})}));
const tableRows: readonly AeliqoTableRow[] = catalogRows.map((row) => ({id: row.id ?? null, name: row.name ?? null, team: row.team ?? null, date: row.date ?? null, amount: row.amount ?? null}));
const personKeys = ["string:3:ada", "string:5:grace"] as const;
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<AeliqoSelectionSummaryElement>("aeliqo-selection-summary", root);
element.label = "People selected";
element.entity = "person";
element.selectedKeys = [personKeys[0], personKeys[1]];
element.result = catalogRef;
element.scope = catalogScope;
element.clearable = true;
}))(root);
Purpose#
Show what is selected: picked record keys or a server-side filter. Clear selection sends a request for the application to handle.
When to use it#
- Show a selected count next to a table or list.
- Distinguish chosen records from a server-side selection scope.
- Offer a clear action the host confirms.
When to use a different component#
- Use FilterBuilder when people need to change the filter itself.
- Use Table when browsing and selecting rows is the main task.
Properties and defaults#
Selection keys or predicate scope stay explicit; clear is a host request and does not mutate data by itself.
| Property | Use and ownership | Declared type | Initial value |
|---|---|---|---|
selectedKeys | Controls the current collection selection using stable encoded identities. | readonly string[] | [] |
selectionScope | Declares whether selected identities refer to loaded rows or a broader explicit predicate scope. | AeliqoSelectionScope | undefined | undefined |
entity | Names the catalog entity whose records and identities are displayed. | string | 'record' |
result | Supplies the Result reference that binds displayed data to its query and scope evidence. | ResultRef | undefined | undefined |
scope | Supplies the visible authorization and population scope associated with the displayed value or rows. | AeliqoDataScope | undefined | undefined |
label | Provides the visible label and accessible name for the component. | string | 'Selection' |
clearable | Enables or disables clearable as explicit host-controlled state. | boolean | true |
status | Supplies the explicit ready, loading, empty, partial, stale, or error state. | AeliqoDataStatus | 'ready' |
message | Provides the user-facing status, error, or recovery message. | string | '' |
Events#
| Event | Payload | Emitted | Application responsibility |
|---|---|---|---|
aeliqo-selection-clear | The current selection scope and an empty proposed selection. | After the clear-selection action. | Clear application selection state without changing the underlying result. |
Events cross the component boundary as user proposals. Validate their detail and current authority before applying a business effect.
Listen for aeliqo-selection-clear
const element = document.querySelector('aeliqo-selection-summary');<p>element?.addEventListener('aeliqo-selection-clear', (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
- loading
- partial
- stale
- error
Expected result: The count and active scope are announced and clearing emits a typed request.
Keyboard, focus, and accessibility#
Keyboard behavior:
- Tab
- Enter
- Space
Exposed semantics:
- aria-live
- button
- role
Responsive behavior#
Let the count, scope, and clear action wrap together. Keep the scope associated with the selected count.
Style hooks#
- Shadow parts:
clear,label,scope,status,summary,text - Varendo design tokens referenced:
--aeliqo-color-accent,--aeliqo-color-muted,--aeliqo-control-compact-target,--aeliqo-space-4,--aeliqo-space-8,--aeliqo-typography-font-size-caption
Related components#
Generated TypeScript declaration#
View generated declaration
export declare class AeliqoSelectionSummaryElement extends LitElement {
static readonly aeliqoVersion = "0.1.0";
static readonly properties: {
selectedKeys: {
attribute: boolean;
};
selectionScope: {
attribute: boolean;
};
entity: {
type: StringConstructor;
};
result: {
attribute: boolean;
};
scope: {
attribute: boolean;
};
label: {
type: StringConstructor;
};
clearable: {
type: BooleanConstructor;
};
status: {
type: StringConstructor;
};
message: {
type: StringConstructor;
};
};
selectedKeys: readonly string[];
selectionScope: AeliqoSelectionScope | undefined;
entity: string;
result: ResultRef | undefined;
scope: AeliqoDataScope | undefined;
label: string;
clearable: boolean;
status: AeliqoDataStatus;
message: string;
protected render(): import("lit").TemplateResult<1>;
private summaryText;
private readonly clearSelection;
static readonly styles: import("lit").CSSResult[];
}Version#
This page documents the Varendo 0.6 component contract.
