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

rn-responsive-typography

v0.1.0

Published

rn-responsive-typography is a lightweight React Native utility library that standardizes font sizes and line heights across your app for consistent typography. Easily define and reuse scalable text styles to maintain visual harmony and improve readability

Readme

rn-responsive-typography

🎨 A lightweight React Native utility library that standardizes font sizes and line heights across your app for consistent typography.

Easily define and reuse scalable text styles to maintain visual harmony and improve readability on all screen sizes.

npm version npm downloads license

✨ Features

  • 📱 Responsive font sizes - Automatically scale across different screen sizes
  • 📏 Paired line heights - Pre-calculated line heights for perfect typography
  • 🎯 Ready-to-use values - fontSize10, fontSize12, fontSize14... up to fontSize84
  • 🎨 Consistent design - Maintain visual harmony across your entire app
  • ⚡ Zero configuration - Works out of the box
  • 📦 Lightweight - Minimal bundle size impact
  • 🔧 TypeScript support - Full type definitions included

🚀 Installation

npm install rn-responsive-typography

or

yarn add rn-responsive-typography

📖 Usage

Basic Usage

import React from 'react';
import { Text, View } from 'react-native';
import { fontSize16, fontSize24, lignHeight20, lignHeight28 } from 'rn-responsive-typography';

const MyComponent = () => {
  return (
    <View>
      <Text style={{ fontSize: fontSize24, lineHeight: lignHeight28 }}>
        Large Title
      </Text>
      <Text style={{ fontSize: fontSize16, lineHeight: lignHeight20 }}>
        Body text that looks great on all screen sizes
      </Text>
    </View>
  );
};

Available Font Sizes

// Font sizes (responsive values)
fontSize10, fontSize12, fontSize14, fontSize16, fontSize18, fontSize20,
fontSize22, fontSize24, fontSize26, fontSize28, fontSize30, fontSize32,
fontSize34, fontSize36, fontSize38, fontSize40, fontSize42, fontSize44,
fontSize46, fontSize48, fontSize50, fontSize52, fontSize54, fontSize56,
fontSize58, fontSize60, fontSize62, fontSize64, fontSize66, fontSize68,
fontSize70, fontSize72, fontSize74, fontSize76, fontSize78, fontSize80,
fontSize82, fontSize84

// Line heights (optimized for readability)
lignHeight20, lignHeight21, lignHeight22, lignHeight23, lignHeight24,
lignHeight26, lignHeight27, lignHeight28, lignHeight29, lignHeight30,
lignHeight32, lignHeight34, lignHeight38, lignHeight43, lignHeight47,
lignHeight51, lignHeight53, lignHeight56, lignHeight57, lignHeight60,
lignHeight72

Helper Functions

import { resFontSize, screenHeight, screenWidth } from 'rn-responsive-typography';

// Custom responsive font size
const customFontSize = resFontSize(2.5); // 2.5% of screen height

// Screen dimensions as percentage
const headerHeight = screenHeight("10%"); // 10% of screen height
const buttonWidth = screenWidth("80%");   // 80% of screen width

📏 How It Works

The library uses responsive calculations based on:

  • Screen dimensions - Adapts to different device sizes
  • Optimized ratios - Pre-calculated font-to-line-height ratios
  • Accessibility standards - Follows platform typography guidelines

💡 Why rn-responsive-typography?

Before

// Hard to maintain, inconsistent across devices
<Text style={{ fontSize: 16, lineHeight: 20 }}>Title</Text>
<Text style={{ fontSize: 14, lineHeight: 18 }}>Subtitle</Text>

After

// Consistent, responsive, maintainable
<Text style={{ fontSize: fontSize16, lineHeight: lignHeight20 }}>Title</Text>
<Text style={{ fontSize: fontSize14, lineHeight: lignHeight22 }}>Subtitle</Text>

🎨 Best Practices

  1. Consistent Pairing: Always pair font sizes with appropriate line heights
  2. Semantic Usage: Use larger sizes for headings, smaller for body text
  3. Accessibility: The pre-defined ratios ensure good readability
  4. Performance: Import only what you need

🔧 API Reference

Font Sizes

All font sizes are calculated as percentages of screen height for optimal responsiveness.

Line Heights

Line heights are calculated as percentages of screen width to maintain proper text flow.

Helper Functions

  • resFontSize(percentage) - Custom responsive font size
  • screenHeight(percentage) - Get percentage of screen height
  • screenWidth(percentage) - Get percentage of screen width

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

MIT License - see the LICENSE file for details.

🙏 Credits

Built with ❤️ using create-react-native-library


Made with ❤️ for the React Native community