Skip to content

Magical & easy method for responsive fontSize based on screen width to support all size devices.

License

Notifications You must be signed in to change notification settings

AndroConsis/rn-responsive-font

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rn-responsive-font

A magical & easy method for responsive fontSize based on screen width to support all size devices.

How to install

yarn add rn-responsive-font

npm install rn-responsive-font --save

How it looks on different devices

rn-responsive-font

Usage example

import React, {Component} from 'react';
import { Text, View } from 'react-native';

import resp from "rn-responsive-font";

class App extends Component {
  render() {
	  return <View style={styles.container}>
		  <Text style={styles.text}>
			  My App fits all screen
		  </Text>
	  </View>
  }
}

const styles = {
	container: {
		flex: 1, 
		justifyContent: "center",
		alignItems: "center"
	},
	text: {
		// I want idle size to be 20
		fontSize: resp(20)
	}
}

It supports both the platforms Android & iOS

About

Magical & easy method for responsive fontSize based on screen width to support all size devices.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published