functions

ZebraList
Edited: Sunday 25 January 2026

ZebraList

Category: Widgets
File: lists.go
Package: ui

Signature

1func ZebraList(l *List, len int, ele layout.ListElement) W

Description

ZebraList wraps a list with alternating row backgrounds for improved readability.
Even-indexed rows (0, 2, 4…) receive a light background color (SILVER_100).

Example:

list := NewVerticalList()
zebra := ZebraList(&list, 50, func(c C, i int) D {
    return Label(fmt.Sprintf("Row %d", i))(c)
})

Commonly used for tables and data lists to distinguish rows visually.

Examples

ZebraList

1{
2	list := NewVerticalList()
3	zebra := ZebraList(&list, 8, func(c C, i int) D {
4		return Inset1(Label(fmt.Sprintf("Row %d", i)))(c)
5	})
6	_ = zebra
7}

Example Output


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

Backlinks