functions

NewClickableList
Edited: Sunday 25 January 2026

NewClickableList

Category: Widgets
File: lists.go
Package: ui

Signature

1func NewClickableList() ClickableList

Description

NewClickableList creates a new clickable list with zebra striping.
Each row automatically gets click handling and alternating backgrounds.

Example:

list := NewClickableList()
widget := list.Layout(10, func(c C, i int) D {
    return Label(fmt.Sprintf("Item %d", i))(c)
}, func(i int) {
    fmt.Printf("Clicked row %d\n", i)
})

The onClick callback receives the index of the clicked row.

Examples

NewClickableList

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

Example Output


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

Backlinks