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

native-stylist

v1.1.1

Published

[![npm version](https://img.shields.io/npm/v/native-stylist)](https://www.npmjs.com/package/native-stylist)

Readme

Native Stylist

npm version

Native Stylist is an npm package designed to streamline the process of styling React Native components. It provides a set of utilities to manage styles more efficiently and consistently.

This was inspired by, but is way less powerful than, Tailwind CSS + NativeWind.

Table of Contents

Installation

You can install Native Stylist using npm or yarn:

npm install native-stylist

or

yarn add native-stylist

API

<View /> Component

The View component exported from Native Stylist is an enhanced version of the standard React Native View component. It supports additional boolean properties for margins and paddings, making it easier to apply spacing.

The spacing unit is 8. In the future I'd like to allow for changing this, but for now it's set.

Margin Properties

  • m1 to m8: Sets margin of 1 to 8 units on all sides.
  • mt1 to mt8: Sets margin top of 1 to 8 units.
  • mr1 to mr8: Sets margin right of 1 to 8 units.
  • mb1 to mb8: Sets margin bottom of 1 to 8 units.
  • ml1 to ml8: Sets margin left of 1 to 8 units.
  • mHalf, mtHalf, mrHalf, mbHalf, mlHalf: Sets margin on one or all sides to a half unit

Padding Properties

  • p1 to p8: Sets padding of 1 to 8 units on all sides.
  • pt1 to pt8: Sets padding top of 1 to 8 units.
  • pr1 to pr8: Sets padding right of 1 to 8 units.
  • pb1 to pb8: Sets padding bottom of 1 to 8 units.
  • pl1 to pl8: Sets padding left of 1 to 8 units.
  • pHalf, ptHalf, prHalf, pbHalf, plHalf: Sets padding on one or all sides to a half unit

Gap Properties

  • gap1 to gap8: Sets gap of 1 to 8 units between children.

Grow/Shrink Properties

  • grow1: Sets { flexGrow: 1 }
  • shrink1: Sets { flexShrink: 1 }

Layout

  • absolute: Sets { position: 'absolute' }
  • relative: Sets { position: 'relative' }
  • pinToTop: Sets { top: 0 }
  • pinToRight: Sets { right: 0 }
  • pinToBottom: Sets { bottom: 0 }
  • pinToLeft: Sets { left: 0 }
  • fullWidth: Sets { width: '100%' }
  • halfWidth: Sets { width: '50%' }
  • flex1: Sets { flex: 1 }
  • flexRow: Sets { flexDirection: 'row' }
  • flexColumn: Sets { flexDirection: 'column' }
  • justifyStart: Sets { justifyContent: 'flex-start' }
  • justifyCenter: Sets { justifyContent: 'center' }
  • justifyEnd: Sets { justifyContent: 'flex-end' }
  • justifyBetween: Sets { justifyContent: 'space-between' }
  • justifyAround: Sets { justifyContent: 'space-around' }
  • alignStart: Sets { alignItems: 'flex-start' }
  • alignCenter: Sets { alignItems: 'center' }
  • alignEnd: Sets { alignItems: 'flex-end' }
  • z1 to z4: Sets zIndex to 1 to 4
  • br1 to br4: Sets borderRadius to 14, 8, 16, and 32 units
  • overflowHidden: Sets { overflow: 'hidden' }

Shadow Properties

  • shadow: Sets a shadow with a default configuration
  • shadowUp: Sets a shadow that goes up, good for using on a fix bottom bar

Background Color Properties

(This needs to be improved)

  • bgWhite: Sets background color to white
  • bgGray: Sets background color to gray

<Text /> Component

The Text component exported from Native Stylist is an enhanced version of the standard React Native Text component. It supports additional boolean properties for margins and paddings, making it easier to apply spacing.

The spacing unit is 8. In the future I'd like to allow for changing this, but for now it's set.

Color Properties

  • light: Sets { color: '#ffffff' }
  • lightish: Sets { color: '#757575' }
  • error: Sets { color: '#B30000' }
  • brand: Sets the color to the brand color (see ###Customization)

Size, Weight, and Style Properties

  • bold: Sets { fontWeight: 'bold' } or { fontFamily: 'your-specified-bold-font} if set.
  • small Sets { fontSize: 16 } - This is the default size
  • xsmall Sets { fontSize: 14 }
  • medium Sets { fontSize: 20 }
  • large Sets { fontSize: 24 }
  • xlarge Sets { fontSize: 32 }
  • xxlarge Sets { fontSize: 48 }
  • underline: Sets { textDecorationLine: 'underline' }
  • strikeThrough: Sets { textDecorationLine: 'line-through' }
  • italic: Sets { fontStyle: 'italic' }

Other Properties

  • shadow: Sets a shadow with a default configuration
  • center: Sets { textAlign: 'center' }

Margin Properties

  • m1 to m8: Sets margin of 1 to 8 units on all sides.
  • mt1 to mt8: Sets margin top of 1 to 8 units.
  • mr1 to mr8: Sets margin right of 1 to 8 units.
  • mb1 to mb8: Sets margin bottom of 1 to 8 units.
  • ml1 to ml8: Sets margin left of 1 to 8 units.
  • mHalf, mtHalf, mrHalf, mbHalf, mlHalf: Sets margin on one or all sides to a half unit

Padding Properties

  • p1 to p8: Sets padding of 1 to 8 units on all sides.
  • pt1 to pt8: Sets padding top of 1 to 8 units.
  • pr1 to pr8: Sets padding right of 1 to 8 units.
  • pb1 to pb8: Sets padding bottom of 1 to 8 units.
  • pl1 to pl8: Sets padding left of 1 to 8 units.
  • pHalf, ptHalf, prHalf, pbHalf, plHalf: Sets padding on one or all sides to a half unit

Usage

import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context';

import { Text, View } from 'native-stylist';

export default function App() {
  return (
    <SafeAreaProvider>
      <SafeAreaView>
        <Text ml2 xlarge bold>
          This is a Title
        </Text>
        <Text ml2 medium lightish>
          Maybe a subtitle here
        </Text>
        <View pt4 pl2 pr2 flexRow justifyBetween>
          <Text>I am on the left</Text>
          <Text>right over here</Text>
        </View>

        <View mt4 flexRow gap1 style={{ height: 100 }}>
          <View
            p1
            flex1
            alignStart
            justifyStart
            style={{ backgroundColor: 'red', alignItems: 'flex-start' }}>
            <Text light>Red</Text>
          </View>
          <View
            p1
            flex1
            alignCenter
            justifyCenter
            style={{ backgroundColor: 'green' }}>
            <Text light>Green</Text>
          </View>
          <View
            p1
            flex1
            alignEnd
            justifyEnd
            style={{ backgroundColor: 'blue' }}>
            <Text light>Blue</Text>
          </View>
        </View>

        <View mt4 relative style={{ height: 200, backgroundColor: '#ff7800' }}>
          <View m2 absolute z1 pinToTop pinToRight bgWhite shadow br2 p1>
            <Text bold>X</Text>
          </View>
        </View>
      </SafeAreaView>
    </SafeAreaProvider>
  );
}

Examples

Fonts and Colors

Instead of using the default colors and fonts, you can customize them by using the StylistTheme context provider. This will allow you to set your own colors and fonts in once place. You'll need to wrap your app with this provider

import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context';

import { Text, View, StylistTheme } from 'native-stylist';

export default function App() {
  return (
    <SafeAreaProvider>
      <StylistTheme.Provider
        value={{
          fontFamily: 'maven-pro',
          fontFamilyBold: 'maven-pro-black',
          brandColor: colors.green,
        }}
      >
        <Text>This text and any further text nested inside the provider will have its `fontFamily` set to `maven-pro` and bold `fontFamily` set to `maven-pro-black.</Text>
        <Text brand>This text color will match that passed in the `brandColor` valu ein the provider.</Text>
      </StylistTheme>
    </SafeAreaProvider>
  );