What would be a good approach to building a “modul...
# compose
n
What would be a good approach to building a “modular” composable. e.g. something that has a header,content,footer section. Would you you write it like fun Container(header: () -> Composable, content: () -> Composable, footer: () -> Composable): Composable ?
a
you can take a look at how
Scaffold
is implemented
👍 2
r
Yes, was typing out the same reply. Have a look at
androidx.compose.material.Scaffold
in the
androidx.compose.material:material:1.0.0
module.
👍 2
n
Super thanks will have a look
j
Check the concept slot in compose
👍 3
d
It's also in the documentation with Scaffold as example: https://developer.android.com/jetpack/compose/layouts/basics#slot-based-layouts
💯 2
1