UNPKG

react-native-responsive-screen-font

Version:

Make React Native views responsive for all devices screens and fonts with the use of 4 simple methods.

36 lines (30 loc) 790 B
This is an example repository that contains a sample setup of `react-native-responsive-screen-font` package. # Usage ```javascript import { widthPercentageToDP as wp, heightPercentageToDP as hp, } from "react-native-responsive-screen-font"; class Login extends Component { render() { return ( <View style={styles.container}> <View style={styles.textWrapper}> <Text style={styles.myText}>Login</Text> </View> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1 }, textWrapper: { height: hp("70%"), // 70% of height device screen width: wp("80%"), // 80% of width device screen }, myText: { fontSize: hp("5%"), // End result looks like the provided UI mockup }, }); export default Login; ```