https://kotlinlang.org logo
#compose
Title
# compose
a

allan.conda

02/04/2021, 9:33 AM
Are there considerations for exposing internal components/functions for building material components like
Switch
so we can build our own design components with less effort? Just like we have
BasicTextField
, I’m wondering if we could have something like
BasicSwitch
. Currently we resort to copy-pasting non-public components in order to easily build our own design. I’m wondering if this is the ideal way to move forward for such cases.
j

jim

02/04/2021, 10:54 AM
We generally expose such functions as public API if we found them to be useful in our own implementations, but don't go out of our way to artificially create such widgets. I don't think a
BasicSwitch
was ever needed/implemented, so we don't expose one. If you find that there is some private API which exists and is not exposed and you think would be valuable, please feel free to start a thread or open a bug and we can consider. That said, please do not be afraid of copy paste. For more details, see Sebastian Markbage's amazing talk here:

https://www.youtube.com/watch?v=4anAwXYqLG8

👍 2
a

allan.conda

02/04/2021, 10:57 AM
Ohh, interesting ^. Will check it out!