
Compose Multiplatform Patterns
If you're building Compose UI across Android, iOS, desktop, or web, this covers the patterns you'll actually use: single state objects with StateFlow, type-safe navigation with serializable routes, slot-based composable design, and platform-specific UI with expect/actual. The event sink pattern is smart for screens with lots of user actions, and the performance section gets specific about stable types, derivedStateOf, and lazy list keys. It's opinionated aboutViewModel + StateFlow over raw mutableStateOf and warns against passing NavController down the tree. Most useful when you're past hello world and need to structure a real KMP app with shared UI that doesn't fight the framework.
- skills.sh installs
- 5.6K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill compose-multiplatform-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Compose Multiplatform Patterns
Patterns for building shared UI across Android, iOS, Desktop, and Web using Compose Multiplatform and Jetpack Compose. Covers state management, navigation, theming, and performance.
When to Activate
- Building Compose UI (Jetpack Compose or Compose Multiplatform)
- Managing UI state with ViewModels and Compose state
- Implementing navigation in KMP or Android projects
- Designing reusable composables and design systems
- Optimizing recomposition and rendering performance
State Management
ViewModel + Single State Object
Use a single data class for screen state. Expose it as StateFlow and collect in Compose:
data class ItemListState(
val items: List<Item> = emptyList(),
val isLoading: Boolean = false,
val error: String? = null,
val searchQuery: String = ""
)
class ItemListViewModel(
private val getItems: GetItemsUseCase
) : ViewModel() {
private val _state = MutableStateFlow(ItemListState())
val state: StateFlow<ItemListState> = _state.asStateFlow()
fun onSearch(query: String) {
_state.update { it.copy(searchQuery = query) }
loadItems(query)
}
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Debugging, Mobile Development
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Llm Trading Agent Security5.6K
- Swiftui Patterns5.6K
- Github Ops5.6K
- Autonomous Loops5.6K
- Data Scraper Agent5.6K
- Springboot Verification5.6K
- Django Verification5.6K
- Django Celery5.6K
- Dotnet Patterns5.6K
- Blueprint5.5K
- Ecc Guide5.5K
- Code Tour5.5K
- Nuxt4 Patterns5.5K
- Healthcare Phi Compliance5.5K
- Inventory Demand Planning5.5K
- Agentic Os5.5K
- Product Capability5.5K
- Security Bounty Hunter5.5K
- Ai First Engineering5.5K
- Prisma Patterns5.5K
- Continuous Agent Loop5.5K
- Continuous Learning5.5K
- Agent Eval5.5K
- Exa Search5.5K