0.3.0 • Published 7 months ago
@hungshidro/react-native-ui-library v0.3.0
react-native-ui-library
a library made my hungshidro
Installation
npm install @hungshidro/react-native-ui-library
Usage
import { createColorWrapper } from '@hungshidro/react-native-ui-library';
// ...
const config = {
dark: {
background: 'black',
color: 'white',
},
light: {
background: 'blue',
color: 'white',
},
};
const { ColorProvider, setThemeColor, useColorTheme } =
createColorWrapper(config);
const TestComponent = () => {
const color = useColorTheme();
return (
<View
style={{
backgroundColor: color?.background,
}}
>
<Text style={{ color: color?.color }}>
background color: {color?.background}
</Text>
</View>
);
};
return (
<ColorProvider>
<TestComponent />
</ColorProvider>
);
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