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

react-native-whirlwind

v0.3.0

Published

Whirlwind is a utility-first styling framework designed for React Native. It is heavily inspired by Tachyons and Tailwind CSS and uses low-level building blocks for rapidly building custom designs.

Downloads

180

Readme

React Native Whirlwind 🌪️

A utility-first CSS framework designed for React Native.

license react-native npm prettier downloads


Whirlwind is a utility-first CSS framework specifically designed for React Native. It is heavily inspired by both Tachyons and Tailwind CSS and uses low-level building blocks for rapidly building custom designs.

  • Readable 👀 - All classes follow a simple, consistent naming convention
  • Lightweight 🪶 - No 3rd party dependencies
  • Composable 🧱 - Combinable classes for rapid prototyping
  • Customizable 💅 - Define your colors, typography, and spacing for your app in one place
  • Performant 🚀 - No unnecessary calculations, no unnecessary string parsing, just pure and fast static styles
  • Reusable ♻️ - Promote reusability in your team and reduce redundancies in your codebase
  • React Native and TypeScript first 🥇 - built for React Native and 100% written in TypeScript for a best-in-class developer experience

Getting Started

React Native has a powerful feature that allows you to pass an array of styles rather than just a single object to the style prop of a component. This can be used to inherit styles. Whirlwind relies on this mechanic to provide a simple, composable API for building custom designs.

1. Install React Native Whirlwind

Install react-native-whirlwind using npm or yarn:

# Using npm
npm install react-native-whirlwind

# Using yarn
yarn add react-native-whirlwind

2. Create Your Theme Definition

Create a new file theme.jsx somewhere in your project source folder, e.g. next to your App.jsx, and call the createTheme function from react-native-whirlwind. To customize your theme, simply pass your desired colors and other properties as parameter:

// theme.jsx
import { createTheme } from 'react-native-whirlwind'

const t = createTheme({
  colors: {
    primary: 'orange',
    secondary: 'blue'
  }
})

export default t

This will customize the primary and secondary colors of your app. The exported constant t acts as the entry point to the Whirlwind style system. You can use any variable name but I recommend using something short and memorable, as it will be heavily used throughout your application. t has proven to be a useful pattern and is recommended for consistency with the documentation and other apps based on Whirlwind.

3. Use Your Theme

Import your theme.jsx in your app and components where needed:

// App.jsx
import { View, Text } from 'react-native'
import t from './theme'

export default function App() {
  return (
    <View style={[t.flex1, t.bgWhite, t.justifyCenter, t.itemsCenter]}>
      <Text style={[t.textPrimary]}>Welcome to Whirlwind</Text>
    </View>
  )
}

Documentation

For full documentation, visit https://arabold.github.io/react-native-whirlwind/.

Live Example

https://snack.expo.dev/@arabold/react-native-whirlwind

Platform Support

supports Expo supports iOS supports Android supports web

Whirlwind is 100% compatible with the Expo Framework and works with both Expo Go and in the bare workflow.

For more details refer to the Platform Support section in the documentation.

Who Is Using Whirlwind?

I'm using the predecessor and variants of Whirlwind for several years now and in many different commercial projects. Some of them have several 100,000s of installs across the App Store and Google Play. Finally, I decided to open source it and make it available to the community. This is how Whirlwind was born.

If you're using it in your project and like to see it listed here, please let me know!