Skip to Content

Lui.Scroll

Creates a ScrollView.

Lui.Scroll("h-96 bg-slate-950 rounded-lg p-3", Lui.Div("flex flex-col gap-2", Lui.ForEach(items, item => ItemRow(item).Key(item.Id)) ) )

Use flex-row for horizontal scroll mode.

Focused elements inside scroll views automatically scroll into view when reached by keyboard/gamepad navigation.

Examples:

Vertical:

Lui.Scroll("h-96 p-3 bg-slate-950 rounded-lg", Lui.Div("flex flex-col gap-2", Lui.ForEach(rows, row => Row(row).Key(row.Id)) ) )

Horizontal:

Lui.Scroll("flex-row h-32 p-3 bg-slate-950", Lui.Div("flex flex-row gap-3", Lui.ForEach(cards, card => Card(card).Key(card.Id)) ) )

Use keys for dynamic scroll content so rows are reused and moved instead of recreated.

Lui.Scroll materializes every child. For large collections (leaderboards, quest logs, save slots, inventories, shops) use the virtualized builders instead, which only mount the visible window.

Last updated on