Skip to content

ScrollView

Scrollable container. Child elements are parented inside the scroll content area.

lua
local scroll = ui:element({
    id = "log_scroll", type = "scrollview",
    rect = { unit = "px", x = 10, y = 50, w = 460, h = 200 },
    props = { content_height = "800" },
    style = {
        bg = "#0F172A",
        scrollbar_bg = "#1E293B",
        scrollbar_handle = "#475569",
        scroll_speed = "30",
    },
})

-- Add children inside the scroll content
for i = 1, 20 do
    scroll:element({
        id = "row_" .. i,
        type = "label",
        rect = { unit = "px", x = 5, y = (i - 1) * 30, w = 440, h = 28 },
        props = { text = "Log entry " .. i },
        style = { color = "#E2E8F0", font_size = 11 },
    })
end
PropDescription
content_heightTotal scrollable content height in pixels (default 500)
StyleDescription
bgScroll area background
scrollbar_bgScrollbar track color
scrollbar_handleScrollbar handle color
scroll_speedScroll sensitivity (default 20)
padding_bottomExtra padding at content bottom (default 20)

⚠️ This documentation was AI-generated and may contain inaccuracies. Please submit pull requests with corrections as needed.