CollectionView Overview
CollectionView
CollectionView renders rows of items efficiently. Rows can be horizontal lists, grids, or fully custom Hosanna views.
Quick Start
Tip: Edit Markers in Snippets
Inside getViews() place your editable code between // --- edit below --- and // --- edit above ---. Then run npm run generate-hosanna-runner.
⚙️ Key Concepts
Rows & Cells
- Rows:
HorizontalRow,ListRow,GridRow, orCustomViewRow. - Cells: Typically
DynamicCellthat displays a fragment defined in style JSON. - Fragments: Server-style JSON that defines views and per-state styles.
Row Settings (Style JSON)
Rows are configured by style keys like rows.regular:
Cell Fragments (Normal vs Focused)
API Surface
- CollectionView:
dataSource,onItemSelected(event),onItemFocus(event),onRowFocus(event). - DataSource:
appendRows,removeRow,appendItemsToRow,removeItemsFromRow,updateItem,ChangeRowHidden. - Row Types:
HorizontalRow,ListRow,GridRow,CustomViewRow. - Focus: Floating/fixed focus, focus indicators, focused scale.
- Performance: Virtualized rows and cells, fragment pooling, node reuse.
Learn More
- CollectionView API: API
- Row & Cell Settings: See
ewtn/assets/meta/style.config.jsonunderrows.*andcells.*. - Fragments:
hosanna-ui/docs/ui/view-fragments.md.