# yuiScrollState

A yui scroll state record carrying contentWidth, contentHeight, viewportWidth, viewportHeight, offsetX, 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 yuiScrollState
```

- int contentWidth: Stores content width as int.
- int contentHeight: Stores content height as int.
- int viewportWidth: Stores viewport width as int.
- int viewportHeight: Stores viewport height as int.
- int offsetX: Stores offset x as int.
- int offsetY: Stores offset y as int.
- int lineStep: Stores line step as int.
- int pageOverlap: Stores page overlap as int.
- text source: Stores source as text.
- text diagnostic: Stores diagnostic as text.
- yuiScrollState(int lineStep, int pageOverlap, text source): Yui scroll state.
- MaximumOffsetX() returns int: Maximum offset x.
- MaximumOffsetY() returns int: Maximum offset y.
- ValidationIssue() returns text: Validation issue.
- ClampOffsets(): Clamp offsets.
- SetGeometry(int contentWidth, int contentHeight, int viewportWidth, int viewportHeight) returns bool: Set geometry.
- ScrollBy(int deltaX, int deltaY) returns bool: Scroll by.
- ScrollWheel(int wheelX, int wheelY) returns bool: Scroll wheel.
- PageStepX() returns int: Page step x.
- PageStepY() returns int: Page step y.
- HandleKey(text key) returns bool: Handle key.
- BringIntoView(yuiLayoutRect contentRect) returns bool: Bring into view.
- VisibleContentRect() returns yuiLayoutRect: Visible content rect.
- BarGeometry(text axis, int trackStart, int trackLength, int minimumThumbLength) returns yuiScrollBarGeometry: Bar geometry.
- RenderReport() returns text: Render report.

## Use yuiScrollState

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.
yuiScrollState sample = yuiScrollState(1, 1, "example")
Console.Log(Text.From(sample.contentWidth))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.MaximumOffsetX

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Maximum offset x.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int result = instance.MaximumOffsetX()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-MaximumOffsetX-11 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.MaximumOffsetY

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Maximum offset y.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int result = instance.MaximumOffsetY()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-MaximumOffsetY-12 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.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.
yuiScrollState instance = yuiScrollState(1, 1, "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__yuiscrollstate"
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--yuiScrollState/method-ValidationIssue-13 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.ClampOffsets

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Clamp offsets.
yuiScrollState instance = yuiScrollState(1, 1, "example")
instance.ClampOffsets()
Console.Log("ClampOffsets completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-ClampOffsets-14 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.SetGeometry

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Set geometry.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int argument_contentWidth = 1
int argument_contentHeight = 1
int argument_viewportWidth = 1
int argument_viewportHeight = 1
bool result = instance.SetGeometry(argument_contentWidth, argument_contentHeight, argument_viewportWidth, argument_viewportHeight)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-SetGeometry-15 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.ScrollBy

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Scroll by.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int argument_deltaX = 1
int argument_deltaY = 1
bool result = instance.ScrollBy(argument_deltaX, argument_deltaY)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-ScrollBy-16 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.ScrollWheel

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Scroll wheel.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int argument_wheelX = 1
int argument_wheelY = 1
bool result = instance.ScrollWheel(argument_wheelX, argument_wheelY)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-ScrollWheel-17 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.PageStepX

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Page step x.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int result = instance.PageStepX()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-PageStepX-18 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.PageStepY

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Page step y.
yuiScrollState instance = yuiScrollState(1, 1, "example")
int result = instance.PageStepY()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-PageStepY-19 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.HandleKey

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Handle key.
yuiScrollState instance = yuiScrollState(1, 1, "example")
text argument_key = "argument key"
bool result = instance.HandleKey(argument_key)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-HandleKey-20 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.BringIntoView

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Bring into view.
yuiScrollState instance = yuiScrollState(1, 1, "example")
yuiLayoutRect argument_contentRect = yuiLayoutRect(1, 1, 1, 1)
bool result = instance.BringIntoView(argument_contentRect)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-BringIntoView-21 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.VisibleContentRect

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Visible content rect.
yuiScrollState instance = yuiScrollState(1, 1, "example")
yuiLayoutRect result = instance.VisibleContentRect()
Console.Log("Inspect result in your debugger")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-VisibleContentRect-22 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.BarGeometry

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Bar geometry.
yuiScrollState instance = yuiScrollState(1, 1, "example")
text argument_axis = "argument axis"
int argument_trackStart = 1
int argument_trackLength = 1
int argument_minimumThumbLength = 1
yuiScrollBarGeometry result = instance.BarGeometry(argument_axis, argument_trackStart, argument_trackLength, argument_minimumThumbLength)
Console.Log("Inspect result in your debugger")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiscrollstate"
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--yuiScrollState/method-BarGeometry-23 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiScrollState.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.
yuiScrollState instance = yuiScrollState(1, 1, "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__yuiscrollstate"
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--yuiScrollState/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-scroll.yh

AI training permission: https://demonhunterlabs.com/ai-use
