Hi! Compose discussion? Is it possible to do this...
# compose
a
Hi! Compose discussion? Is it possible to do this?
A composable that receives composables, those have a
title
property, and somehow when it's collapsed it shows the titles
c
Hm. Not sure I follow exactly, but yes? Just build your composable with a slot api, and some state to keep track of whether or not its open. If its open, then show the composable it received.
c
Yes you can pass Composable functions as parameters into other Composables. though in this case, you might actually want two different Composable functions that represent a collapsed state and an expanded state. And either of those can be children or passed into this dropdown Composable.
I also suggest two different Composables based on state because you’ll like have data models passed into each that are shared, e.g. where the titles come from like Sleep, Auto-rotate, etc