Skip to content

Interface: ScrollViewProps

Gorilla Engine JavaScript API / GorillaEngine / UI / ScrollViewProps

Properties and scrolling methods for a viewport containing child components.

alpha: number

Sets the opacity level of the component, ranging from 0.0 (fully transparent) to 1.0 (fully opaque).

Common.alpha


alwaysOnTop: boolean

If true, the component will always be rendered on top of other components within the same stacking context, regardless of their Z-order.

Common.alwaysOnTop


clickGrabsKeyboardFocus: boolean

If true, a mouse click on this component will automatically transfer keyboard focus to it, allowing for immediate keyboard interaction.

Common.clickGrabsKeyboardFocus


enabled: boolean

Determines if the component is active. If false, the component will not respond to user input (e.g., clicks, keyboard events) but may still be visible.

Common.enabled


height: number

The height of the component in pixels.

Bounds.height


hideHorizontalScrollbar: boolean

Hides the horizontal scrollbar.

false

hideVerticalScrollbar: boolean

Hides the vertical scrollbar.

false

id: string

A unique identifier for the component. This ID is needed for referencing and managing the component within the application’s hierarchy.

Common.id


ignoreKeypressEvent: boolean

Whether the scroll view declines keyboard input instead of handling it for scrolling.

false

optional scrollbar?: object

Defines the color of the background, thumb and track of the scrollbar.

optional background?: string

optional thumb?: string

optional track?: string

Scrollable.scrollbar


scrollbarThickness: number

The thickness of the scrollbar in pixels.


visible: boolean

Controls the visibility of the component. If set to false, the component will not be rendered.

Common.visible


wantsKeyboardFocus: boolean

Indicates whether the component requests keyboard focus when it becomes active or is programmatically highlighted. This is important for keyboard navigation and input.

Common.wantsKeyboardFocus


width: number

The width of the component in pixels.

Bounds.width


x: number

The x-coordinate of the component’s top-left corner, typically measured from the left edge of its containing element or viewport.

Bounds.x


y: number

The y-coordinate of the component’s top-left corner, typically measured from the top edge of its containing element or viewport.

Bounds.y

scrollChildIntoView(childIndex): void

Scrolls the child at the given index into view.

number

The index of the child to scroll into view.

void


setScrollPositionProportionately(xPos, yPos): void

Sets the scroll position of the view.

number

The horizontal scroll position in pixels.

number

The vertical scroll position in pixels.

void