百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-full-responsive

> 编程语言
开源

为所有受支持的平台创建完全响应式的 React Native 应用

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

为所有受支持的平台创建完全响应式的 React Native 应用

Create a fully responsive React Native app for all supported platforms

Introduction

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

Features

  • Easy to use: Effortlessly implement size scaling and responsive design.
  • Cross-platform: Works seamlessly across multiple platforms and devices.
  • createRStyle method and useRStyle hook as alternatives to using StyleSheet.create for create stylesheets.
  • Various responsive hooks provided: Use these hooks based on your specific use cases.
  • Customizable scaling: Define base widths for specific dimension types (xs, sm, ... 2xl) for precise control.
  • Responsive percentage-based sizing: Adjust sizing based on width or height by PixelRatio.
  • Media query hook: Detect dimension types by using the useMediaQuery hook. You can also override default thresholds as needed. This hook can be used in the provider to automatically detect and respond based on the configurations.
  • Various responsive Higher-Order Components (HOCs) provided: Utilize these methods in your class components.
  • Written in TypeScript and fully typed.

Installation

Supported for React Native >= 0.60

bash
yarn add react-native-full-responsive

//or

npm install react-native-full-responsive --save

Quick Start

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:

…

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:

typescript
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

Documentation

Explore the usage documentation to discover how to leverage the methods, hooks, and other features.

Contribution

See the contributing guide to learn how to contribute to the repository and the development workflow.

Test

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:

    typescript
    export * from 'react-native-full-responsive/jest';

️ License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言