ScrollingFrame

ScrollingFrame : GuiObject

Overview

A container that clips its children and provides horizontal and/or vertical scrolling when content exceeds the visible area. Useful for long lists, chat logs, inventories, and any UI with overflow.

Properties

AbsoluteCanvasSize

Vector2

Read-only size of the total scrollable content in pixels after layout is applied. Use this to know the full extent of content regardless of the current window size.

Code Samples

AbsoluteWindowSize

Vector2

Read-only size of the visible area (viewport) in pixels. This corresponds to the inner window that shows the content without scrolling.

Code Samples

AutomaticCanvasSize

Enum.AutomaticSize

Automatically adjusts CanvasSize based on children and layout. Set to None to manually control CanvasSize.

Code Samples

CanvasSize

UDim2

Total size of the scrollable content area. If larger than the window, scrollbars may appear depending on settings and ScrollingDirection.

Code Samples

local frame = Instance.new("ScrollingFrame")
frame.Size = UDim2.new(0, 300, 0, 200)
frame.CanvasSize = UDim2.new(0, 300, 0, 800) -- content taller than window enables vertical scroll
frame.Parent = script.Parent

CanvasPosition

Vector2

The current scroll offset in pixels. X scrolls horizontally; Y scrolls vertically. Setting this programmatically moves the viewport.

Code Samples

local frame = script.Parent -- ScrollingFrame
frame.CanvasPosition = Vector2.new(0, 120) -- scroll down 120px

ScrollBarImageColor3

Color3

Tint color applied to the scrollbar visuals (track/handle), allowing theme customization.

Code Samples

ScrollBarImageTransparency

number

Transparency for scrollbar visuals from 0 (opaque) to 1 (fully transparent).

Code Samples

ScrollBarThickness

number

Thickness of the scrollbars in pixels. Increase for touch targets; decrease to save space.

Code Samples

ScrollingDirection

Enum.ScrollingDirection

Controls permitted scroll axes: X (horizontal), Y (vertical), or XY (both). Affects user input and clamping of CanvasPosition.

Code Samples

ScrollingEnabled

bool

Enables user-initiated scrolling when true. When false, CanvasPosition is fixed for user input but can still be changed by scripts.

Code Samples

Methods

MoveToSlot

Moves the scroll viewport to make the specified content slot index visible. Typically used with virtualized or slot-based lists.

Parameters

unumber32 SlotIndex

Return

void

Code Samples

-- Example: Jump to item index 50 in a virtualized list
local list = script.Parent -- ScrollingFrame
if list.MoveToSlot then
    list:MoveToSlot(50)
end

Events

Last updated