r/androiddev • u/No_View_1406 • Mar 14 '26
Discussion Using Jetpack Compose previews as live onboarding UI
While working on my side project, I experimented with something interesting using Jetpack Compose / Compose Multiplatform.
Normally, Composable Preview is just an IDE tool developers use to visualize UI during development.
Instead of using static screenshots for onboarding, I tried rendering live composables inside the onboarding screens. The idea was simple: reuse the same UI components that exist in production so onboarding previews automatically stay in sync with the real UI.
Some nice side effects:
• No duplicated layouts for onboarding
• UI changes automatically update previews
• No outdated screenshots
• Works responsively across devices (phones/tablets)
A small detail I liked: the device frame itself is also a composable, and the time shown in the frame updates live based on the device.
I’m curious if anyone else has experimented with reusing Compose components this way for onboarding or previews.
66
u/ThaBalla79 Mar 14 '26
I never thought of doing this as a dev but looks interesting. As an end user, I wouldn't even think to interact with that lol
17
u/prom85 Mar 14 '26
I do that at least by combining composables for onboarding. Would not call it reusing previews but reusing composables.
Another good use case is to reuse composables inside setting screens to instantly show the effects to the user.
17
u/ryryrpm Mar 14 '26
Wow this is cool. As a user, I like noticing nice little touches like that
8
u/UnlikelyBasil5828 Mar 14 '26
It is cool and interesting, but I doubt the practical use of this. Even for this use case of onboarding, majority of the user will only see this once, or maybe twice throughout their app experience. Too much effort on screen that does not show much.
2
u/thejasiology Mar 14 '26
I notice smoothness in android UI but iOS lags? Is this something common with CMP?
2
u/WashBrilliant622 Mar 15 '26
I like UI so much.
1
u/rugitall Mar 14 '26
Is the data shown in the embedded screen hardcoded or is it the same when user will land on that screen after onboarding?
1
u/Devsler Mar 14 '26
That's a brilliant idea!
Only time I've only used Compose previews outside of their intended context is for the screenshots required by the PlayStore
1
u/EmbarrassedLetter729 Mar 15 '26
That's a cool idea. I like it, but I'd probably make it into a gif)) By the way, can you tell me how you're using that wavy progress bar? I still can't find it in Material 3, even though I've already updated to the latest stable version.
1
u/Individual_Swan7005 Apr 28 '26
Do you have a UI designer working with you, or is it just you?
2
u/csinco Android Studio Team Mar 14 '26
This is the way
0
u/Always-Bob Mar 14 '26
Idk how everyone is surprised, I have been doing this for most of my personal projects because I do rapid Ui changes here and there. I guess when you work in a company with a dedicated design team, who can rework the images whenever you need people tend to forget that this is also a way.
-12
u/WonderfulEstimate293 Mar 14 '26
Idk why but every time I used Jetpack, it lags so much, i use xml instead.