I'm working on an Android app using Jetpack Compose where users can customize their own screen layouts to create a native-feeling UI. The layout structure is completely dynamic — at runtime, based on some logic or user preferences, the app decides what UI elements (like Text, Button, etc.) and containers (Row, Column, Box, etc.) to render, and how to nest them.
For example, one user might have a Column with a Text and a Button, while another might have a Box containing nested Rows and multiple buttons. This configuration isn't known at compile time.
I’ve looked at the official Compose samples (https://github.com/android/compose-samples), but those examples seem to define UIs with fixed layouts known at compile time.
My question is: How can I dynamically build and render these varying UI hierarchies at runtime using Compose?
If you've worked on something similar or know of strategies to handle this kind of dynamic rendering, any guidance would be much appreciated!