Propagating text theme through context and platform specific modules #21
Replies: 3 comments 15 replies
-
Thanks for bringing this up. I am trying to step away from I did add Typography which I feel is close to what you are suggesting. The idea behind having What you're suggesting would be that the Interesting. I will definitely look into that. Thank you |
Beta Was this translation helpful? Give feedback.
-
I can work on it if you don't mind then I can share implementation details and if you like the direction it's heading I can make it into a PR |
Beta Was this translation helpful? Give feedback.
-
Thank you for your suggestion! It is now merged: cfec919 Feel free to open a different discussion for improvements to web stuff like some of the features |
Beta Was this translation helpful? Give feedback.
-
Hello, this is such a lovely idea and I am excited about the prospect of having a library similar to shadcn/ui in react native/expo. My team and I have been doing something similar to create UI components and style system for our app and there are a few ideas that I would like to propose:
Composable text styles
One main challenge that we ran into is how to handle the lack of text style inheritance in react native since some components such as buttons greatly benefit from this on the web to easily specify the font style in the component.
From what I have seen from various OSS projects attempting to create shadcn equivalents, the approach seems to be either:
ButtonText
orButton.Text
component: While this is straightforward, I find having to use different text components for different components a bit inconsistenttextClass
. This is way less flexible and becomes a problem when you consider various combinations like: text button, text+icon button, etcI've conceptualised the following idea and would like to see what you think
This
Text
component would be used throughout the app and for components such as buttons where custom base text style is needed, one only need override theTextContext
value.Platform specific modules
I was very excited when I learnt of the ability to specify
platform.tsx
to create platform specific modules. Since expo web has nearly full support for shadcn/ui and similar web UI libraries, I think it would be a nice pattern if platform specific modules could be leverage to have near parity with the shadcn library for web while ensuring the equivalent native modules also offer as much support as possible while maintaining a similar APII'd be glad to hear your thoughts on these. I'd also be glad to be able to contribute to this amazing library
Beta Was this translation helpful? Give feedback.
All reactions