Skip to content

UIScrollView

Defined in: ui/src/UIScrollView.ts:72

A clipped, scrollable viewport that owns a normal Yoga child subtree.

Unlike the imperative @pixi/ui wrappers, this is a true UIContainerElement: children are first-class Yoga nodes laid out by the existing layout pass, so it works identically via the React reconciler (<ScrollView>), the UIPanel builder (.scrollView()), or direct addElement. Content overflowing the viewport on the scroll axis is clipped by a mask and panned by a wheel/drag-driven offset that survives re-renders (the node instance is stable; only children are diffed).

new UIScrollView(props): UIScrollView

Defined in: ui/src/UIScrollView.ts:110

UIScrollViewProps

UIScrollView

readonly yogaNode: Node

Defined in: ui/src/UIScrollView.ts:73

UIContainerElement.yogaNode

get children(): readonly UIElement[]

Defined in: ui/src/UIScrollView.ts:182

readonly UIElement[]

UIContainerElement.children


get displayObject(): DisplayContainer

Defined in: ui/src/UIScrollView.ts:106

DisplayContainer

UIContainerElement.displayObject


get maxScroll(): number

Defined in: ui/src/UIScrollView.ts:206

Maximum scrollable offset (content overflow), computed each layout.

number


get scrollbarGutter(): number

Defined in: ui/src/UIScrollView.ts:214

Px reserved on the scroll-cross edge for the scrollbar so content never renders under the thumb. 0 when the scrollbar is hidden.

number


get scrollOffset(): number

Defined in: ui/src/UIScrollView.ts:201

Current scroll offset in pixels along the scroll axis.

number


get visible(): boolean

Defined in: ui/src/UIScrollView.ts:393

boolean

set visible(v): void

Defined in: ui/src/UIScrollView.ts:397

boolean

void

UIContainerElement.visible

addElement(child): void

Defined in: ui/src/UIScrollView.ts:186

UIElement

void

UIContainerElement.addElement


applyLayout(): void

Defined in: ui/src/UIScrollView.ts:241

void

UIContainerElement.applyLayout


destroy(): void

Defined in: ui/src/UIScrollView.ts:458

Idempotent — a second call is a no-op.

void

UIContainerElement.destroy


insertElementBefore(child, before): void

Defined in: ui/src/UIScrollView.ts:194

UIElement

UIElement

void

UIContainerElement.insertElementBefore


removeElement(child): void

Defined in: ui/src/UIScrollView.ts:190

UIElement

void

UIContainerElement.removeElement


scrollBy(delta): void

Defined in: ui/src/UIScrollView.ts:235

Scroll by a relative delta (clamped). Positive = toward content end.

number

void


scrollTo(offset): void

Defined in: ui/src/UIScrollView.ts:230

Scroll to an absolute offset (clamped).

number

void


update(props): void

Defined in: ui/src/UIScrollView.ts:402

Partial<UIScrollViewProps>

void

UIContainerElement.update