affaan-m avatar

Compose Multiplatform Patterns

Teaches you modern Compose patterns for building shared UI across Android, iOS, desktop, and web. Covers the single state object pattern with StateFlow, type-safe navigation with serializable routes, slot-based composable APIs, and performance optimization through stable types and lazy list keys. The event sink pattern is a solid alternative to passing a dozen lambdas around. Also handles platform-specific UI with expect/actual and shows you the right modifier ordering. Most useful when you're moving beyond basic tutorials and need production patterns for state management, navigation flows, and recomposition performance.

skills.sh installs
5K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill compose-multiplatform-patterns --agent claude-code

Installs 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/everything-claude-code
Category
Mobile Development
First seen
Apr 16, 2026

More from affaan-m/everything-claude-code

All 256
1dotnet avatarmaui-app-lifecycledotnet/skills.NET MAUI app lifecycle guidance — the four app states, cross-platform Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying), 4Kskills.sh installs
2sickn33 avatarmobile-designsickn33/antigravity-awesome-skillsmobile design3Kskills.sh installs
3safaiyeh avatarapp-store-reviewsafaiyeh/app-store-review-skillapp store review1.6Kskills.sh installs
4capawesome-team avatarionic-expertcapawesome-team/skillsA comprehensive starting point for AI agents to work with the Ionic Framework. Covers core concepts, components, CLI, theming, layout, lifecycle, navigation, an1.6Kskills.sh installs
5mapbox avatarmapbox-ios-patternsmapbox/mapbox-agent-skillsOfficial integration patterns for Mapbox Maps SDK on iOS. Covers installation, adding markers, user location, custom data, styles, camera control, and featurese1.5Kskills.sh installs
6mapbox avatarmapbox-android-patternsmapbox/mapbox-agent-skillsOfficial integration patterns for Mapbox Maps SDK on Android. Covers installation, adding markers, user location, custom data, styles, camera control, and featu1.5Kskills.sh installs