<list>
A virtualized scrolling list for long or growing data. Only items near the screen are drawn, and their views are reused as you scroll.
Usage
Import LYNX_ELEMENTS in your component (see Elements).
Every <list-item> needs a unique item-key, or the app crashes. Use the same value as your @for track expression.
Attributes
Plus the common attributes, such as id, class and style.
Item gaps are CSS properties that only <list> understands, not attributes. Set list-main-axis-gap and list-cross-axis-gap in style, e.g. style="list-main-axis-gap: 8px;".
Events
Read the payload from $event.detail (see Handling taps and events).
Plus the common events, such as bindtap.
Methods
These UI methods (Glossary) scroll it from code. Call them with invoke() on the element (see Call element methods). A call from a handler returns nothing: to read a result, call invoke() in a main-thread script instead.
Children
Every direct child must be a <list-item>. Don't set z-index on a <list-item>, because it breaks view reuse: set it on the content inside.
<list-item>
Related
<scroll-view>: for a short, fixed set of children- List: the UI component built on it
- CSS on Lynx
- Call element methods
