Skip to Content
Kinemium

ScrollingFrame

A frame with a scrollable canvas and scroll bars.

ScrollingFrame is a GuiObject whose children are laid out on a larger canvas. The visible window stays fixed while the canvas moves, and scroll bars can appear automatically.

Getting started

local list = Instance.new("ScrollingFrame")
list.Size = UDim2.fromOffset(300, 400)
list.CanvasSize = UDim2.fromOffset(0, 1200)
list.ScrollBarThickness = 6
list.Parent = screenGui

for index = 1, 20 do
    local row = Instance.new("TextLabel")
    row.Size = UDim2.new(1, 0, 0, 50)
    row.Position = UDim2.fromOffset(0, (index - 1) * 54)
    row.Text = "Row " .. index
    row.Parent = list
end

Canvas properties

PropertyTypeAccessDescription
CanvasPositionVector2Read/writeCurrent scroll offset.
CanvasSizeUDim2Read/writeSize of the scrollable area.
AutomaticCanvasSizeEnum.AutomaticSizeRead/writeExpand the canvas to fit content.
AbsoluteWindowSizeVector2Read-onlyVisible window size in pixels.
AbsoluteCanvasSizeVector2Read-onlyResolved canvas size in pixels.

Scrolling properties

PropertyTypeAccessDescription
ScrollingEnabledbooleanRead/writeAllow user scrolling.
ScrollingDirectionEnum.ScrollingDirectionRead/writeAxis the content scrolls along.
ScrollSpeednumberRead/writeMultiplier for wheel and drag scrolling.
SmoothScrollingEnabledbooleanRead/writeEase scrolling instead of jumping.
ScrollSmoothnessnumberRead/writeEasing strength for smooth scrolling.
VirtualizedScrollingbooleanRead/writeOnly lay out visible content.

Scroll bar properties

PropertyTypeAccessDescription
ScrollBarThicknessnumberRead/writeBar thickness in pixels.
ScrollBarImageColor3Color3Read/writeBar color.
ScrollBarImageTransparencynumberRead/writeBar transparency.
ScrollBarAutoHidebooleanRead/writeHide bars when not scrolling.
ScrollBarFadeDelaynumberRead/writeDelay before the bar fades.
ScrollBarFadeSpeednumberRead/writeFade animation speed.
ScrollBarMinimumHandleSizenumberRead/writeSmallest handle size.
VerticalScrollBarInsetEnum.ScrollBarInsetRead/writeVertical bar inset mode.
HorizontalScrollBarInsetEnum.ScrollBarInsetRead/writeHorizontal bar inset mode.
TopImagestringRead/writeImage for the top scroll button.
MidImagestringRead/writeImage for the scroll track.
BottomImagestringRead/writeImage for the bottom scroll button.

Notes

  • CanvasPosition is in pixels and is clamped to the scrollable range.
  • CanvasSize uses UDim2, so it can scale with the window or use fixed pixels.
  • AutomaticCanvasSize grows the canvas based on children; combine it with a layout for dynamic lists.
  • AbsoluteWindowSize and AbsoluteCanvasSize are resolved values for reading.
  • Inherits all GuiObject members, including ClipsDescendants.

See also

  • GuiObject for shared layout.
  • UIListLayout and UIGridLayout for arranging the contents.
  • Frame for a non-scrolling container.

On this page