functions
NewClickableList| modified | Sunday 25 January 2026 |
|---|
Category: Widgets
File: lists.go
Package: ui
1func NewClickableList() ClickableList
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.
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}

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