
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-full-responsive
Advanced tools
Create a fully responsive React Native app for all supported platforms
This package makes it super easy to create apps responsive that work perfectly on all different screen sizes in React Native (like font size, width, height, and more), making sure everything looks great on any device, from extra small to extra large. You can also tweak how things scale and adjust settings to make everything just the way you want it.
|
|
|
|
| iPhone 15 Pro Max | iPhone SE (3rd gen) | iPad Pro (12.9-inch) | Web |
StyleSheet.create for create stylesheets.(xs, sm, ... 2xl) for precise control.PixelRatio.Supported for React Native >= 0.60
yarn add react-native-full-responsive
//or
npm install react-native-full-responsive --save
Starting from v2, you can easily create your styles using the createRStyle or useRStyle hooks
Use createRStyle in a similar way to when you use StyleSheet.create:
import * as React from 'react';
import { View, Text } from 'react-native';
import { createRStyle } from 'react-native-full-responsive';
const SIZE = 20;
export default function App() {
return (
<View style={styles.container}>
<View style={styles.box}>
<Text style={styles.textBold}>My awesome responsive text!</Text>
</View>
</View>
);
}
const styles = createRStyle({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
height: `${SIZE * 3}rs`,
justifyContent: 'center',
backgroundColor: 'yellow',
marginVertical: `${SIZE}rs`,
paddingHorizontal: `${SIZE / 2}rs`,
},
textBold: {
fontWeight: 'bold',
fontSize: `${SIZE}rs`,
},
});
Alternatively, use useRStyle to create dynamic styles that change when dimensions, bases, or types are modified:
import * as React from 'react';
import { View, Text } from 'react-native';
import { FRProvider, useRStyle } from 'react-native-full-responsive';
const SIZE = 20;
const ResponsiveBox: React.FC = () => {
const styles = useRStyle({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
height: `${SIZE * 3}rs`,
justifyContent: 'center',
backgroundColor: 'yellow',
marginVertical: `${SIZE}rs`,
paddingHorizontal: `${SIZE / 2}rs`,
},
textBold: {
fontWeight: 'bold',
fontSize: `${SIZE}rs`,
},
});
return (
<View style={styles.container}>
<View style={styles.box}>
<Text style={styles.textBold}>My awesome responsive text!</Text>
</View>
</View>
);
};
export default function App() {
return (
<FRProvider type="sm">
<ResponsiveBox />
</FRProvider>
);
}
Alternatively, make use of the responsive methods and hooks that are available from v1:
import * as React from 'react';
import { Text } from 'react-native';
import { useRM, FRProvider } from 'react-native-full-responsive';
//...
const MyComponent = () => {
const { rs } = useRM();
const scaledValue = rs(20);
return (
<Text style={{ fontSize: scaledValue }}>My awesome responsive text!</Text>
);
};
export default function App() {
return (
<FRProvider>
<MyComponent />
</FRProvider>
);
}
To become more familiar with how to use methods within your function or class components, check out the provided examples.
Also, if you're looking to become more familiar with how to use the package as a universal responsive utility, check out Todo App project for a practical example
Explore the usage documentation to discover how to leverage the methods, hooks, and other features.
See the contributing guide to learn how to contribute to the repository and the development workflow.
To mock the package's methods and components using the default mock configuration provided, follow these steps:
Create a file named react-native-full-responsive.ts inside your __mocks__ directory.
Copy the following code into that file:
export * from 'react-native-full-responsive/jest';
MIT
FAQs
Create a fully responsive React Native app for all supported platforms
The npm package react-native-full-responsive receives a total of 637 weekly downloads. As such, react-native-full-responsive popularity was classified as not popular.
We found that react-native-full-responsive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.