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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nativesystem

v1.0.0-beta.13

Published

A set of utils, views and systems to help you structure and use your theme and create your dynamically themed components using `glamorous`. **Inspired by `styled-system` & focused on `react-native`.**

Downloads

7

Readme

Native System

A set of utils, views and systems to help you structure and use your theme and create your dynamically themed components using glamorous.
Inspired by styled-system & focused on react-native.

The idea

The library makes use of a theme containing a set of colors, an array of easily accessible spacings and sub-themes.
Every sub-theme contains a default styling, but also modified versions, which can be merged with the default one, making it easy to create variations of existing components.
The theme-object will look something like this when written out:

{
    colors: {
        [colorName: string]: Color,
    },
    spacing: number[],
    
    [subThemeName: string]: {
        default: {
            // ... some styles 
        },
        [modifier string]: {
            // ... some different styles
        }
    }
}

An api to build the theme up from scratch (or from a default one) is provided.

Aside from the theming structure, the library provides a set of utilities to easily extract certain colors or sub-themes from the root-theme, including easy helpers to provide dynamic styling to glamorous-type components (this would also work with styled-components or emotion).

Additionally, there are components included which I personally find important when creating my React Native apps (they are not compatible for web, sadly). Some might be more useful to you and your app than others.
These include the following:

  • Keyboard Handling
    A component sent using context to easily animate components across a component-tree to handle the keyboard gracefully.
  • View/SystemView: an easily styled View-alternative
  • Containers
    A range of containers:
    • Screen: easy wrapper to configure properties related to your app's screen, like the StatusBar.
    • Row: a row/list-entry component with a wide range of configurations.
    • Card: a material design-styled card.
    • Absolute: a pre-styled component that's positioned absolutely and takes positioning props.
    • Modal: A wrapper around React Native's native modal, with included overlay and a component to prevent propagation of the close-event.
    • SimpleModal: A pre-composed modal. Just pass in some children and handlers.
    • CardModal: A modal styled like a card.
    • DismissArea: A component handling touches outside of TextInputs to dismiss the keyboard.
  • Coordinator
    A powerful helper-component to easily coordinate more complex animations, so you don't have to spend ages writing interpolations and positioning.
  • Input: A wrapper around React Native's TextInput & a helper to more easily wire up your inputs with Formik. Also contains styled TextInputs with error-handling and such.
  • Button:
    • Base: A wrapper for your mark-up to easily add native touch handling without impacting your layout.
    • Button: A styled button component.
  • Misc:
    • Text: A text component. Wow.
    • Separator: A line. To separate things.
    • WithThemeFAC: I like FACs. So I made this. Allows you to get values out of your theme without using a higher order component per se.
    • Spinner: For when your app has not loaded data yet.