react-native-material3-theme
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i react-native-material3-theme

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

54 kB

Total Files

30

Last publish

Collaborators

  • szechyjs