Stay organized with collections
Save and categorize content based on your preferences.
Compose previews are a powerful tool for
visualizing composables at design time in Android Studio, but manually setting
up mock data for the preview parameters can be time-consuming. Gemini in Android
Studio includes a feature that solves this problem: automated Compose preview
generation.
You can access this tool in two ways:
Within any composable, right-click and navigate to Gemini > Generate
"<composable>" Preview or Generate Compose Previews for this file.
If you don't have any previews set up yet, in the empty preview panel click
Auto-generate Compose Previews for this file.
When you ask Gemini to generate Compose previews, you get a diff view with
Gemini's suggested Compose preview code where you can accept or reject the
proposed changes. Gemini's code should provide a valuable starting point to
accelerate your development workflow.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-31 UTC."],[],[],null,["# Generate Compose previews\n\n| **Preview:** Enable Compose preview generation through [Studio Labs](/studio/gemini/labs).\n\n[Compose previews](/develop/ui/compose/tooling/previews) are a powerful tool for\nvisualizing composables at design time in Android Studio, but manually setting\nup mock data for the preview parameters can be time-consuming. Gemini in Android\nStudio includes a feature that solves this problem: automated Compose preview\ngeneration.\n\nYou can access this tool in two ways:\n\n- Within any composable, right-click and navigate to **Gemini \\\u003e Generate\n \"\\\u003ccomposable\\\u003e\" Preview** or **Generate Compose Previews for this file**.\n\n | **Note:** You only see the option to generate Compose previews for the whole file if there are multiple composables in the file that don't have associated previews.\n\n- If you don't have any previews set up yet, in the empty preview panel click\n **Auto-generate Compose Previews for this file**.\n\nWhen you ask Gemini to generate Compose previews, you get a diff view with\nGemini's suggested Compose preview code where you can accept or reject the\nproposed changes. Gemini's code should provide a valuable starting point to\naccelerate your development workflow."]]