optimizing-lazy-layouts

Optimize Jetpack Compose lazy layouts with key management and contentType.

8|Updated May 18, 2025
One-click install
npx skills add https://github.com/decoutkhanqindev/DexReader --skill optimizing-lazy-layouts-decoutkhanqindev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimizing-lazy-layouts
Source: https://github.com/decoutkhanqindev/DexReader/tree/main/.claude/skills/optimizing-lazy-layouts
Command: npx skills add https://github.com/decoutkhanqindev/DexReader --skill optimizing-lazy-layouts-decoutkhanqindev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses common performance issues in Jetpack Compose's lazy layouts, such as scroll jank, lost item state, and broken animations, by providing best practices and code examples.

Core Features & Use Cases

  • Performance Optimization: Fix scroll jank, dropped frames, and item state loss in lazy layouts.
  • Stability Enhancement: Ensure item composables are stable and reusable.
  • Use Case: For a developer experiencing lag and visual artifacts in a LazyColumn or LazyRow, this Skill offers solutions to stabilize item keys, use contentType for mixed feeds, and validate composables.

Quick Start

Run the optimizing-lazy-layouts skill to apply best practices for improving the performance of lazy layouts in your Compose app.

Frequently Asked Questions about optimizing-lazy-layouts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix scroll jank and dropped frames in Jetpack Compose lazy layouts?

Fix scroll jank in Jetpack Compose lazy layouts by stabilizing item keys, utilizing contentType for mixed feeds, and validating that item composables remain stable and reusable to prevent dropped frames during scrolling.

How do I prevent lost item state in a LazyColumn or LazyRow?

Prevent lost item state in a LazyColumn or LazyRow by implementing proper key management, which ensures item composables remain stable and reusable across recompositions, preserving their state during scroll events.

When should I use contentType in Jetpack Compose lazy layouts?

Use contentType in Jetpack Compose lazy layouts when rendering mixed feeds with multiple item types, allowing the layout to reuse composables effectively and avoid visual artifacts or performance degradation during scrolling.

Do I need to know Jetpack Compose to optimize lazy layouts?

Yes, optimizing lazy layouts requires existing knowledge of Jetpack Compose and basic performance optimization principles to successfully implement item keys, contentType usage, and animateItem() animations within your application.

Why does animateItem() cause visual artifacts in my LazyGrid?

animateItem() may cause visual artifacts in a LazyGrid if item composables lack stability, meaning proper key management and composable validation are required to ensure animations perform smoothly without breaking.

What's the best way to stabilize item composables in Jetpack Compose lazy layouts?

The best way to stabilize item composables in Jetpack Compose lazy layouts is to apply consistent item keys, utilize contentType for mixed item structures, and validate composable stability to ensure reusability.