# yuiVirtualCollection

A yui virtual collection record carrying kind, itemCount, itemExtent, overscanRows, crossAxisCount, and related state.

Last updated: 2026-09-09

Package: ui | Status: source-declared

Tags: cpu, method, source-example, thing, ui, yeho

Build YUI's reusable control, layout, interaction, text, accessibility, and retained-rendering models.

```yh
external thing yuiVirtualCollection
```

- text kind: Stores kind as text.
- int itemCount: Stores item count as int.
- int itemExtent: Stores item extent as int.
- int overscanRows: Stores overscan rows as int.
- int crossAxisCount: Stores cross axis count as int.
- text stableKeyPrefix: Stores stable key prefix as text.
- int realizedStart: Stores realized start as int.
- int realizedEnd: Stores realized end as int.
- int realizedCount: Stores realized count as int.
- int peakRealizedCount: Stores peak realized count as int.
- int recycledCount: Stores recycled count as int.
- int generation: Stores generation as int.
- text selectedKey: Stores selected key as text.
- text focusedKey: Stores focused key as text.
- text source: Stores source as text.
- text diagnostic: Stores diagnostic as text.
- yuiVirtualCollection(text kind, int itemCount, int itemExtent, int overscanRows, text stableKeyPrefix, text source): Yui virtual collection.
- ValidationIssue() returns text: Validation issue.
- SetCrossAxisCount(int count) returns bool: Set cross axis count.
- StableKey(int index) returns text: Stable key.
- Realize(int offset, int viewportExtent) returns yuiVirtualRange: Realize.
- IsRealized(int index) returns bool: Is realized.
- SelectKey(text stableKey) returns bool: Select key.
- FocusKey(text stableKey) returns bool: Focus key.
- RenderReport() returns text: Render report.

## Use yuiVirtualCollection

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using ui

// Build YUI's reusable control, layout, interaction, text, accessibility, and retained-rendering models.
yuiVirtualCollection sample = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
Console.Log(Text.From(sample.kind))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.ValidationIssue

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Validation issue.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
text result = instance.ValidationIssue()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-ValidationIssue-17 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.SetCrossAxisCount

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Set cross axis count.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
int argument_count = 1
bool result = instance.SetCrossAxisCount(argument_count)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-SetCrossAxisCount-18 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.StableKey

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Stable key.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
int argument_index = 1
text result = instance.StableKey(argument_index)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-StableKey-19 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.Realize

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Realize.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
int argument_offset = 1
int argument_viewportExtent = 1
yuiVirtualRange result = instance.Realize(argument_offset, argument_viewportExtent)
Console.Log("Inspect result in your debugger")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-Realize-20 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.IsRealized

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Is realized.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
int argument_index = 1
bool result = instance.IsRealized(argument_index)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-IsRealized-21 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.SelectKey

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Select key.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
text argument_stableKey = "argument stable Key"
bool result = instance.SelectKey(argument_stableKey)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-SelectKey-22 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.FocusKey

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Focus key.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
text argument_stableKey = "argument stable Key"
bool result = instance.FocusKey(argument_stableKey)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-FocusKey-23 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiVirtualCollection.RenderReport

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Render report.
yuiVirtualCollection instance = yuiVirtualCollection("kind", 1, 1, 1, "stable Key Prefix", "example")
text result = instance.RenderReport()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuivirtualcollection"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiVirtualCollection/method-RenderReport-24 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/ui/layout-virtual.yh

AI training permission: https://demonhunterlabs.com/ai-use
