compose-listslisted
Install: claude install-skill pablitoarango/android-skills
# Compose Lists, Grids and Pagers
Sources of truth: [Lists and grids](https://developer.android.com/develop/ui/compose/lists), [Pager](https://developer.android.com/develop/ui/compose/layouts/pager), [Performance best practices](https://developer.android.com/develop/ui/compose/performance/bestpractices).
## 1. Pick the container
| Content | Composable |
|---|---|
| Vertical / horizontal list | `LazyColumn` / `LazyRow` |
| Uniform grid | `LazyVerticalGrid` / `LazyHorizontalGrid` with `GridCells.Fixed(n)` or `GridCells.Adaptive(minSize)` |
| Items of different sizes | `LazyVerticalStaggeredGrid` / `LazyHorizontalStaggeredGrid` |
| One full page at a time | `HorizontalPager` / `VerticalPager` (Compose Foundation) |
| A few items that always fit | `Column` / `Row`, with `verticalScroll` / `horizontalScroll` if needed |
Lazy containers compose only visible items; use them for anything that can grow.
## 2. Items
Always pass a **stable, unique `key`**, and a `contentType` when the list mixes item kinds.
```kotlin
LazyColumn(
contentPadding = PaddingValues(horizontal = 16.dp, vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
item(key = "header", contentType = "header") { FeedHeader() }
items(
items = feedItems,
key = { it.id },
contentType = { it.type },
) { item ->
FeedItemRow(item = item, onClick = { onItemClick(item.id) }, modifier = Modifier.animateItem())
}
}
```
- **Keys** keep item state (inc