https://developer.android.com/agents/skills/jetpack-compose/theming/styles/skill

Migrate Jetpack Compose custom component styling to the experimental Styles API.

5|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/fornewid/android-developers-changelog --skill https-developer-android-com-agents-skills-jetpack-compose-theming-styles-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: https://developer.android.com/agents/skills/jetpack-compose/theming/styles/skill
Source: https://github.com/fornewid/android-developers-changelog/tree/main/docs/agents/skills/jetpack-compose/theming/styles
Command: npx skills add https://github.com/fornewid/android-developers-changelog --skill https-developer-android-com-agents-skills-jetpack-compose-theming-styles-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you migrate Jetpack Compose UI styling from per-parameter and Modifier-based styling into the experimental Compose Styles API while preserving visual consistency.

Core Features & Use Cases

  • Guided migration plan: Walks you through analyzing your theme structure, introducing shared ComponentStyles, and migrating each custom component.
  • State-aware styling: Shows how to use MutableStyleState and interaction sources so styles react correctly to enabled/disabled and other interactive states.
  • Safe validation workflow: Recommends screenshot baselining and verification (including Compose Preview comparisons) to prevent layout regressions.
  • What it targets: Supports custom UI components and custom themes, and explicitly avoids Material Design component Styles.

Quick Start

Use the skill to migrate a custom component to Styles by creating a ComponentStyles.kt file, adding a Style for your component, switching the component signature to accept style: Style, and applying Modifier.styleable() with a state-backed style state.

Frequently Asked Questions about https://developer.android.com/agents/skills/jetpack-compose/theming/styles/skill

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

FAQPage Schema
What is the Jetpack Compose Styles API and when do I need it for UI migration?

Jetpack Compose Styles API is an experimental theming mechanism for migrating scattered component parameters into consolidated styleable modifiers. You need it to eliminate per-parameter styling and achieve consistent, state-driven UI theming without breaking visual layouts.

How do I migrate custom Jetpack Compose components to use the Styles API?

To migrate, define theme tokens, create a ComponentStyles file, switch your component signature to accept a Style object, and apply Modifier.styleable(). You must opt in to ExperimentalFoundationStyleApi and wire tokens via theme exposure to complete the migration.

Does the Compose Styles API work with Material Design components?

No, the Compose Styles API explicitly avoids Material Design component Styles. It targets custom UI components and custom themes to resolve scattered styling parameters using experimental StyleScope fundamentals and state-backed style updates.

How do I handle enabled and disabled states when using Compose Styles?

Handle enabled and disabled states by using MutableStyleState and interaction sources within your ComponentStyles. This state-aware styling approach ensures your custom components react correctly to interactive state changes without losing visual consistency.

What's the best way to validate UI parity when refactoring to Compose Styles?

The best way to validate UI parity is by baselining screenshots and comparing Compose Previews before and after refactoring. This safe validation workflow prevents layout regressions when applying styleable modifiers and state-driven style updates.

Do I need a specific Compose version to use the experimental Styles API?

Yes, you need to upgrade your project to a supported Compose or Foundation alpha version. This allows you to opt in to ExperimentalFoundationStyleApi and access the StyleScope fundamentals required for defining and applying ComponentStyles.