react-native-material3-theme
v0.1.1
Published
Manage Material 3 theme in your React Native App
Downloads
3
Readme
react-native-material3-theme
Manage Material 3 theme in your React Native App
This is a fork of https://github.com/pchmn/expo-material3-theme and modified to remove the Expo requirement.
Installation
npm install react-native-material3-theme
Usage
import { useMaterial3Theme } from 'react-native-material3-theme';
import { useColorScheme, View, Button } from 'react-native';
function App() {
const colorScheme = useColorScheme();
// If the device is not compatible, it will return a theme based on the fallback source color (optional, default to #6750A4)
const { theme } = useMaterial3Theme({ fallbackSourceColor: '#3E8260' });
return (
<View style={{ backgroundColor: theme[colorScheme].background }}>
<Button color={theme[colorScheme].primary}>Themed button</Button>
</View>
);
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library