React Native - Modern theming

React Native - Modern theming

Good day, everyone! Today we'll talk about theme-csx, a new react native theming library that was created to alleviate the pain that developers may experience when attempting to add dark mode support to mobile apps.

Github Link: https://github.com/KJ-GM/theme-csx

Without further ado, let's get started:

Theme-csx focuses on providing an easy and simple way to add dark mode support to our mobile apps. With three simple steps, your app will be set up and ready to go!

You may wonder what makes this library special than other libraries such as styled-components, react native paper...

1) Similar to standard react native styling

2) Light & Fast

3) Expo & React Native

4) Supports React Navigation

System: changes to the phone appearance preference while the app is running will be applied dynamically. - IOS: changes will be shown immediately without the need to reopen the app.

let's go over the steps very briefly:

StyleSheet

  • Is similar to the usual styling format, but now you have additional props to make style themeable.

T() Function - Themed

  • Apply only your themed styles using the T() function wrapper.

TV() Function - Themed Value

  • Is an extra helper function that can be used to theme a specific value. (this becomes helpful with react navigation)

apperanceHook

  • Use the appearanceHook to switch theme from anywhere in your app.


Usage



要查看或添加评论,请登录

社区洞察

其他会员也浏览了