When building a custom design system component library in Compose, is the best approach to go one level below the Material Theme components' level of abstraction? So, for Button, go one layer down to Surface, etc.?
z
Zach Klippenstein (he/him) [MOD]
08/06/2021, 5:51 PM
Surface
is also part of the Material layer. If your design system is based on Material, it might make sense to build wrappers around material components, but if it’s not (and maybe even if it is) you can build everything on the
Foundation
layer and get rid of Material dependencies altogether.
is built off of that.
Trying to think about concerns with maintainability; I guess its better to build off of
Foundation
and reconcile Compose API changes there, versus building off of some Material theme abstraction and then having Material theme API changes to sneak in to your custom components.