interface / @typed/ui/index

Collection.Item

Public Collection.Item behavioral model.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Item metadata
Since
1.0.0
Member of
Collection

Import

import { Collection } from "@typed/ui/index";

Access Collection.Item through the imported Collection export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export interface Item<Value = unknown, Element extends object = globalThis.Element> {
    readonly id: string;
    readonly element?: Element;
    readonly disabled?: boolean;
    readonly submenu?: boolean;
    readonly textValue?: string;
    readonly value?: Value;
}

Why

The public model lets custom composites reuse Collection’s deterministic policy without copying an internal shape.

Ownership and lifetime

This declaration is data or schema metadata and acquires no resources.

Example

Import with import type { Item } from "@typed/ui/Collection"; Extend the Collection.makeState runnable setup. A registered value can retain its real DOM identity: const item: Item<string> = { id: "save", value: "save", element: document.createElement("button") }.

Property: disabled

Flag used by collection movement and widget handlers to skip activation by default.

Property: element

Mounted element handle used for DOM ordering, focus, and scrolling.

Property: id

Stable id used for collection identity and ARIA relationships.

Property: submenu

Whether the item participates as a submenu entry.

Property: textValue

Search text used by typeahead independently of rendered markup.

Property: value

Current semantic value selected or edited by the widget.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source