What problem does it solve?
This Skill provides guidance to help Android developers build robust, reusable UI components with Jetpack Compose by applying state hoisting, proper modifier usage, and consistent theming, reducing churn and bugs in UI code.
Core Features & Use Cases
- Unidirectional data flow and state hoisting: write stateless Composables that receive values and emit events to callers.
- Modifier guidelines: always include a default Modifier parameter and apply it to the root layout; understand modifier ordering effects.
- Performance optimization: leverage remember and derivedStateOf to minimize recompositions and ensure smooth UI.
- Theming and resources: adopt MaterialTheme colorScheme and typography to maintain visual consistency across features.
- Previews: provide private previews for public Composables to verify appearance across themes.
Quick Start
Start by converting a stateful Composable to a stateless one, pass state through parameters and emit events to the caller. Add a Modifier parameter with a default value Modifier and apply it to the root layout. Create a private preview for the composable to verify appearance in Light and Dark modes.