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-prestyle

v0.1.1-next.0

Published

A react-native styling library that transforms styles on build time using babel

Readme

react-native-prestyle

Another react-native styling library but this time it transforms styles on build time using babel.

While the library is currently in development and not yet stable, it offers the potential for improved performance and reliability in styling. Please exercise caution when using this library and report any issues or unexpected behavior you may encounter.

Philosophy

Building styles on build time allows the styles to be precomputed and optimized, which can improve the performance of the application. When styles are built on run time, the application has to calculate the styles every time the component is rendered, which can cause lag and reduce performance.

Usage:

  1. Install the library:
yarn add react-native-prestyle
  1. Add the babel plugin into your babel config file:
{
  "plugins": ["react-native-prestyle/plugin"]
}
  1. Create a theme file:
import { TextStyle, ViewStyle } from "react-native";
import { prestyle } from "react-native-prestyle";

const { ThemedView, ThemedText, ThemeProvider } = prestyle<
  ViewStyle,
  TextStyle
>()({
  light: {
    colors: {
      primary: "white",
      text: "black",
    },
  },
  dark: {
    colors: {
      primary: "black",
      text: "white",
    },
  },
  spacing: {
    m: {
      small: 8,
      medium: 16,
    },
    l: 32,
  },
  breakPoints: {
    small: 0,
    medium: 768,
  },
  viewVariants: {
    card: {
      backgroundColor: "primary",
      padding: "m",
      flex: 1,
    },
  },
  textVariants: {
    bold: {
      color: "primary",
      fontWeight: "bold",
    },
  },
});

export { ThemedView, ThemedText, ThemeProvider };
  1. Usage:
<ThemedView
  variant="card"
  backgroundColor="primary"
  marginBottom="m"
  style={{ marginTop: 10 }}
>
  <ThemedText variant="bold" color="text" marginTop="l">
    Hello I am a text
  </ThemedText>
</ThemedView>

The components ThemedView and ThemedText must be named exactly as such, as they are statically searched for by name.

When parsing the props for the components, the order in which they are defined determines their priority, except for the style prop, which always takes precedence over everything else.

API:

Themes:

| Name | Description | | -------------- | ------------------------------------------------------------------------------ | | light | Colors for the light mode | | dark | Colors for the dark mode | | breakPoints | Width breakpoints | | spacing | Spacing tokens (can be numbers or per breakpoint) | | viewVariants | Shared styles for the ThemedView component, applied using the variant prop | | textVariants | Shared styles for the ThemedText component, applied using the variant prop |

Prestyle:

| Name | Description | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ThemeProvider | A higher-order component that wraps the entire application and provides the theme to all the child components. It takes a mode prop, which can be used to switch between light and dark themes. | | ThemedView | A themed version of the standard React Native View component. It inherits its styles from the current theme provided by the ThemeProvider. | | ThemedText | A themed version of the standard React Native Text component. It inherits its styles from the current theme provided by the ThemeProvider. | | useTheme | A hook that can be used to access the current theme object in any component. | | useSpacing | A hook that can be used to access the spacing values defined in the current theme. It can be used to add consistent padding and margins to components. | | useBreakPoint | A hook that can be used to access the current breakpoint in the application. It can be used to create responsive designs that adapt to different screen sizes. | | usePrestyle | A hook that provides access to everything, including the current mode, theme, spacing, breakpoint, viewVariant, and textVariants. |

Props:

| Theme Property | Name | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | colors | backgroundColor, color, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, shadowColor, textShadowColor, textDecorationColor | | spacing | margin, marginVertical, marginHorizontal, marginRight, marginLeft, marginTop, marginBottom, marginStart, marginEnd, padding, paddingVertical, paddingHorizontal, paddingRight, paddingLeft, paddingTop, paddingBottom, paddingStart, paddingEnd, gap, rowGap, columnGap |

Known Limitations

  • The components ThemedView and ThemedText must be named exactly as such, as they are statically searched for by name.
  • Limited props spreading.