Skip to content

VirtualList

Lays out and paints the visible part of a long or variable-height collection.

Loading interactive demo…

#Import

Import ui from github.com/egoist/quickgui/go/ui.

import (
	"github.com/egoist/quickgui/go/ui"
)

#Usage

func VirtualListExample(rows []string, rowHeights []float64) *ui.Element {
	return ui.VirtualList().Child(func() *native.Node {
		var children []*native.Node
		for _, row := range rows {
			children = append(children, ui.Text(row).Height(36).Node)
		}
		return ui.Fragment(children)
	}).Height(320).EstimatedItemHeight(36).Overscan(6).
		OverscanPixels(240).ItemHeights(rowHeights).FollowMode("normal")

}

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

VirtualList

View source
ui.VirtualList() *Element

VirtualList lays out and paints the visible children using the core's virtual list.

ChildChild(child any) *Element—

Child appends content and returns this element. Content can be an element, native node, scalar, accessor, or node-returning construction callback.

Child(child any) *Element
View source
ChildrenChildren(children ...any) *Element—

Children appends multiple children in order without replacing existing content. It also accepts []any, []*Element, and []*native.Node slices as arguments. Read the retained child nodes through element.Node.Children.

Children(children ...any) *Element
View source
StyleStyle(style StyleBuilder) *Element—

Style merges a reusable style. Scalar accessors retain independent native bindings.

Style(style StyleBuilder) *Element
View source
OnClickOnClick(handler func()) *Element—

OnClick handles a click without an unused event parameter.

OnClick(handler func()) *Element
View source
RefRef(handler func(*native.Node)) *Element—

Ref exposes the native handle once at this point in the declaration chain.

Ref(handler func(*native.Node)) *Element
View source
OnKeyDownOnKeyDown(value func(*native.Event)) *Element—

OnKeyDown configures the corresponding node property.

OnKeyDown(value func(*native.Event)) *Element
View source
OnFocusOnFocus(value func(*native.Event)) *Element—

OnFocus configures the corresponding node property.

OnFocus(value func(*native.Event)) *Element
View source
OnBlurOnBlur(value func(*native.Event)) *Element—

OnBlur configures the corresponding node property.

OnBlur(value func(*native.Event)) *Element
View source
DisabledDisabled(value any) *Element—

Disabled configures the corresponding node property.

Disabled(value any) *Element
View source
AriaLabelAriaLabel(value any) *Element—

AriaLabel configures the corresponding node property.

AriaLabel(value any) *Element
View source
EstimatedItemHeightEstimatedItemHeight(value any) *Element—

EstimatedItemHeight configures the corresponding node property.

EstimatedItemHeight(value any) *Element
View source
OverscanOverscan(value any) *Element—

Overscan configures the corresponding node property.

Overscan(value any) *Element
View source
OverscanPixelsOverscanPixels(value any) *Element—

OverscanPixels configures the corresponding node property.

OverscanPixels(value any) *Element
View source
ItemHeightsItemHeights(value any) *Element—

ItemHeights configures the corresponding node property.

ItemHeights(value any) *Element
View source
ListAlignmentListAlignment(value string) *Element—

ListAlignment configures the corresponding node property.

ListAlignment(value string) *Element
View source
FollowModeFollowMode(value string) *Element—

FollowMode configures the corresponding node property.

FollowMode(value string) *Element
View source
TabIndexTabIndex(value any) *Element—

TabIndex configures the corresponding node property.

TabIndex(value any) *Element
View source