kotlin-compose

Jetpack Compose - composables, state, effects, theming

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "kotlin-compose" with this command: npx skills add pluginagentmarketplace/custom-plugin-kotlin/pluginagentmarketplace-custom-plugin-kotlin-kotlin-compose

Kotlin Compose Skill

Build modern UIs with Jetpack Compose declarative patterns.

Topics Covered

State Management

@Composable
fun Counter() {
    var count by remember { mutableIntStateOf(0) }
    Button(onClick = { count++ }) { Text("Count: $count") }
}

// Derived state
val isValid by remember { derivedStateOf { email.isNotBlank() && password.length >= 8 } }

Side Effects

@Composable
fun UserScreen(userId: String) {
    LaunchedEffect(userId) {
        viewModel.loadUser(userId)
    }

    DisposableEffect(Unit) {
        val listener = viewModel.addListener()
        onDispose { listener.remove() }
    }
}

Modifiers

Box(
    modifier = Modifier
        .fillMaxSize()
        .padding(16.dp)
        .background(MaterialTheme.colorScheme.surface)
        .clickable { onClick() }
)

Material 3 Theming

@Composable
fun AppTheme(content: @Composable () -> Unit) {
    val colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
    MaterialTheme(colorScheme = colorScheme, typography = Typography, content = content)
}

Troubleshooting

IssueResolution
Infinite recompositionUse remember or derivedStateOf
State lost on rotationUse rememberSaveable or ViewModel

Usage

Skill("kotlin-compose")

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

kotlin-android

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

kotlin-testing

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

kotlin-ktor

No summary provided by upstream source.

Repository SourceNeeds Review