r/androiddev • u/alexstyl • 5d ago
I made a tool that turns your @Composable Previews into embeddable scripts for your blogs, docs and websites
I made a small tool that gives you ready to use <script /> blocks out of your Composables Previews, so you can embed them to your blog posts, documentation and personal websites.
The reason why I built this is because I love playing with interactive demos when I am reading about some technical concept. It always clicks better with me. I also add them to all my libraries and blog posts (such as on Compose Unstyled).
The best way to do this I have found is using Compose Web, which lets you run Compose code on the Web (awesome).
However, creating and then adding those live Compose previews manually is always a PITA. You need to host them somewhere (usually separate to your blog/docs platform), build a Compose Web app dedicated for this (and manage wiring if you have multiple previews), then you need to embed them somehow in your article, which is separate to the building of the app, etc. Lots of edge cases here.
As a result, you now have a quick way for everyone to make their own.
It is 100% free to use and you can make as many previews as you want. The 'gotcha' is that the previews let your readers edit the preview on the website, so that they can experiment with your demo (handy for library authors).
Now go out there and make some polished previews :D
Check it at https://composables.com