Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ListProps ¶
type ListProps[T any] struct { OuterProps html.Props ID string Items []T Height float64 RowHeight float64 Overscan int Class string Style map[string]string ItemKey func(T) string RenderRow func(RowRenderProps[T]) ui.Node OnViewportChange func(ViewportDiagnostics) Empty ui.Node InnerClass string }
ListProps describes the first public fixed-height virtualized list surface.
type RowRenderProps ¶
type RowRenderProps[T any] struct { Index int Item T Key string VisibleRange Range RenderedRange Range }
RowRenderProps describes the data exposed to one rendered row callback.
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription tracks one active viewport observation.
func ObserveOwnedViewport ¶
func ObserveOwnedViewport(_ interop.Element, parseViewportConfig ViewportConfig, _ func(ViewportState)) (Subscription, error)
ObserveOwnedViewport is unavailable outside browser builds.
func (Subscription) Cancel ¶
func (parseSubscription Subscription) Cancel()
Cancel stops the active viewport observation.
type ViewportConfig ¶
ViewportConfig describes the fixed-height list contract used by the first virtualization pass.
type ViewportDiagnostics ¶
type ViewportDiagnostics struct {
ScrollTop float64
ViewportHeight float64
TotalItems int
TotalHeight float64
RowHeight float64
Overscan int
VisibleStart int
VisibleEnd int
VisibleCount int
RenderedStart int
RenderedEnd int
RenderedCount int
OverscanBeforeCount int
OverscanAfterCount int
MeasurementCount int
InvalidationCount int
ScrollCorrectionCount int
RowMountCount int
RowUnmountCount int
}
ViewportDiagnostics exposes the current rendered and visible window in a shape that is convenient for examples, debugging, and future devtools.
func (ViewportDiagnostics) WithRowLifecycle ¶
func (parseD ViewportDiagnostics) WithRowLifecycle(parseMounts, parseUnmounts int) ViewportDiagnostics
WithRowLifecycle annotates a diagnostics snapshot with row mount and unmount counters gathered by the list primitive.
type ViewportState ¶
type ViewportState struct {
ScrollTop float64
ViewportHeight float64
TotalItems int
TotalHeight float64
RowHeight float64
Overscan int
Visible Range
Rendered Range
}
ViewportState describes the current scroll offset, viewport height, and the visible plus rendered ranges for one fixed-height list.
func ComputeViewportState ¶
func ComputeViewportState(parseConfig ViewportConfig, parseScrollTop, parseViewportHeight float64) (ViewportState, error)
ComputeViewportState converts scroll metrics into visible and rendered ranges for a fixed-height virtualized list.
func (ViewportState) Diagnostics ¶
func (parseS ViewportState) Diagnostics() ViewportDiagnostics
Diagnostics converts a viewport state into an inspection-friendly summary.