Create a fully responsive React Native app for all supported platforms
Create a fully responsive React Native app for all supported platforms
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)
WebStyleSheet.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 --saveStarting 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:
…Alternatively, use useRStyle to create dynamic styles that change when dimensions, bases, or types are modified:
…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 (
My awesome responsive text!
);
};
export default function App() {
return (
);
}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
No open issues yet, or sync has not completed.