Skill Wiki v0.1.0
rule @android-compose/rule-prefer-stable-keys-in-lazy-column

Prefer Stable Keys In Lazy Column

`LazyColumn`, `LazyRow`, and `LazyVerticalGrid` use the `key` parameter on each item to identify it across recompositions.…

Skill
@android-compose
Domain
android-compose
Version
0.1.0
Quality
4.0
Edges
2 out · 2 in
Tokens
127/270/286
$ prime install @android-compose/rule-prefer-stable-keys-in-lazy-column

Projection

Always in _index.xml · the agent never has to ask for this.

PreferStableKeysInLazyColumn [rule] v0.1.0

LazyColumn, LazyRow, and LazyVerticalGrid use the key parameter on each item to identify it across recompositions. Without a key, Compose falls back to position — which means inserting at the head re-keys every following item, animations break, scroll position drifts, and per-item state (like a remembered expand flag) jumps to the wrong row. Pass a key = { item -> item.id } whose value is stable for the lifetime of that item.

Source

prime-system/examples/android-compose/primes/compiled/@android-compose/rule-prefer-stable-keys-in-lazy-column/atom.yaml

Compiled at 2026-05-10