npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-responsive-style

v1.1.1

Published

## What is React Native Responsive Style

Readme

React Native Responsive Style

What is React Native Responsive Style

React Native Responsive Style is a TypeScript-first responsive stylesheet compatible with React Native, React Native Web and Next.js (including SSR).

Inspired and based on react-native-media-query, this package removes the requirement of using a 2nd prop (dataSet) when applying styles to components. In addition, this allows us now to pass arrays of styles into components like in the example.

Installation

npm

npm install react-native-responsive-style

yarn

yarn add react-native-responsive-style

Usage

StyleSheet

import React, { useState } from "react";
import { Pressable, Text, View } from "react-native";
import { styleSheet } from "react-native-responsive-style";

const styles = styleSheet({
  container: {
    width: "100%",
    backgroundColor: "brown",

    "@media (min-width: 400px) and (max-width: 600px)": {
      backgroundColor: "yellow",
    },
    "@media (min-width: 600px)": {
      backgroundColor: "red",
    },
  },
  anotherContainer: {
    height: 300,

    "@media (min-width: 400px) and (max-width: 600px)": {
      height: 400,
    },
    "@media (min-width: 600px)": {
      height: 500,
    },
  },
  text: {
    color: "red",

    "@media (min-width: 500px)": {
      color: "blue",
    },
  },
});

export default function App() {
  const [state, setState] = useState(true);

  return (
    <View style={[styles.container, styles.anotherContainer]}>
      <Text>Welcome to Expo + Next.js 👋</Text>

      <Pressable onPress={() => setState(!state)}>
        <Text>click me ;)</Text>
      </Pressable>

      {state && (
        <Text style={styles.text}>Hi there, I am a secret message</Text>
      )}
    </View>
  );
}

Inline styles

import React from "react";
import { Text, View } from "react-native";
import { style } from "react-native-responsive-style";

export default function App() {
  const textStyles = style({
    color: "blue",

    "@media (min-width: 550px)": {
      color: "orange",
    },
  });

  return (
    <View>
      <Text style={textStyles}>Hi there ;)</Text>
    </View>
  );
}

SSR with Next.js

In order to have server side rendering enabled, we need to use <RenderSsr /> by rendering media queries in our website's <head> section.

_document.tsx

import Document, { Html, Head, Main, NextScript } from "next/document";
import { RenderSsr } from "react-native-responsive-style";

class MyDocument extends Document {
  render() {
    return (
      <Html>
        <Head>
          <RenderSsr />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </Html>
    );
  }
}

export default MyDocument;