functions

NewVerticalList
Edited: Sunday 25 January 2026

NewVerticalList

Category: Widgets
File: lists.go
Package: ui

Signature

1func NewVerticalList() List

Description

NewVerticalList creates a new vertical scrollable list widget.
The list automatically handles scrolling and viewport management.

Example:

list := NewVerticalList()
widget := func(c C) D {
    return list.Layout(c, 100, func(c C, i int) D {
        return Label(fmt.Sprintf("Item %d", i))(c)
    })
}

Use with list.Layout to render elements with virtualization for performance.

Examples

NewVerticalList

1{
2	list := NewVerticalList()
3	widget := func(c C) D {
4		return list.Layout(c, 10, func(c C, i int) D {
5			return Label(fmt.Sprintf("Item %d", i))(c)
6		})
7	}
8	_ = widget
9}

Example Output


This documentation is auto-generated. To update, run make docs

Backlinks