Preserve Item State in Jetpack Compose LazyColumn with Stable Keys
Learn how to keep UI state (e.g., expanded/collapsed) of list items stable while scrolling and across configuration changes using LazyColumn item keys and rememberSaveable.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to keep UI state (e.g., expanded/collapsed) of list items stable while scrolling and across configuration changes using LazyColumn item keys and rememberSaveable.
Learn how to pair key-based item identity with rememberSaveable in Jetpack Compose’s LazyColumn to keep scroll position, preserve checkbox state across rotations, and cut unnecessary recompositions. Includes a working example, limits, and common pitfalls.
LazyColumn or a scrollable Column? A decision guide covering composition cost, keys, the infinite-constraints crash, and a quick way to validate the difference yourself.
The Jetpack Compose Navigation component relies on rememberSaveable to preserve UI state across configuration changes and process death. However, the scroll offset of a LazyColumn or LazyRow is not automatically saved by this mechanism, leaving the list reset to the top after a rotation or similar event. Developers who need the scroll position to survive nav