:rocket: Interesting update for Jetpack Compose de...
# compose
a
🚀 Interesting update for Jetpack Compose developers! I recently explored the new Experimental Styles API introduced in Jetpack Compose. Some benefits that stood out: Define styles once and reuse them across multiple components Reduce repetitive UI code Easier to maintain large codebases Built-in support for state-based styling (pressed, focused, disabled, etc.) Better consistency across the application This could make building reusable components much simpler and help teams implement design systems more effectively. One important note: Styles are not a replacement for Modifiers. Modifiers still handle layout, input, and behavior, while Styles focus on appearance and visual customization. Although the API is still experimental, it looks like a promising direction for both Jetpack Compose and future Compose Multiplatform development. 📖 Article: https://developer.android.com/develop/ui/compose/styles Would love to hear everyone's thoughts on this new approach to styling in Compose.
d
This new way of styling looks really promising. I am wondering how this will play out with existing component libraries like Compose Unstyled. @Alex Styl do you intend to support these new APIs?
a
This api is currently experimental. It is working with "1.11.0-alpha06" version of compose.
b
I like the performance improvements it claims to have. I had Codex whip up a Styles version of my design system. There were a few bugs so I wouldn't ship to prod, but the direction seems promising. Although I'm not quite understanding how the styling of text works even though it did work mostly. Learning how to distinguish when to use modifier and style will now be a thing. Also when should we store layout fields combined with styles, or extend styles into their own class.
a
@Didier Villevalois Compose Unstyled is not a component library. It the library you use to build component libraries with (brings component primitives, theming API etc) That being said, you can already use the new Styles API to style your components you build using Unstyled already, since it's just a modifier you need to pass.
👍 1
Will be doing some examples of that eventually, but right now all my resources are focused on something else (compose related)
❤️ 1
my 2c on Styles: I like the direction. doing dynamic styling has been a huge PITA so far in Compose (I even came up with my own solution which I use in all of my projects). Having a higher level API instead of having to deal with states and all that is great. Reminds me of how tailwind css does something similar and it's a breeze to work with didn't get the chance to go deep into it, so I'm not sure yet if it's 'just right' yet or not.