Hi! Compose discussion?
Is it possible to do this?
alorma
04/28/2021, 6:21 PM
A composable that receives composables, those have a
title
property, and somehow when it's collapsed it shows the titles
c
Colton Idle
04/28/2021, 6:45 PM
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
Chris Sinco [G]
04/28/2021, 8:31 PM
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.
Chris Sinco [G]
04/28/2021, 8:31 PM
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