All Projects → arabold → react-native-whirlwind

arabold / react-native-whirlwind

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

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to react-native-whirlwind

Tailwind Styled Component
Create Tailwind CSS React components like styled components with class names on multiple lines and conditional class rendering
Stars: ✭ 57 (-37.36%)
Mutual labels:  styled-components, tailwindcss
twin.examples
Packed with examples for different frameworks, this repo helps you get started with twin a whole lot faster.
Stars: ✭ 320 (+251.65%)
Mutual labels:  styled-components, tailwindcss
Twin.macro
🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, stitches and goober) at build time.
Stars: ✭ 5,137 (+5545.05%)
Mutual labels:  styled-components, tailwindcss
Xstyled
A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
Stars: ✭ 1,835 (+1916.48%)
Mutual labels:  styled-components, tailwindcss
Tails Ui
🐒 Clean UI based on tailwindcss
Stars: ✭ 162 (+78.02%)
Mutual labels:  styled-components, tailwindcss
guchub
🎓 Elegantly manage your GUC academic life
Stars: ✭ 15 (-83.52%)
Mutual labels:  styled-components, reactnative
coronadev
Aplicativo para consultar a situação global do COVID-19
Stars: ✭ 44 (-51.65%)
Mutual labels:  styled-components, reactnative
nytimes-bestseller
NY Times best sellers list explorer
Stars: ✭ 35 (-61.54%)
Mutual labels:  styled-components, reactnative
graphql-blog-client
🚀 React Apollo client for a GraphQL blog.
Stars: ✭ 15 (-83.52%)
Mutual labels:  styled-components
material-tailwind-kit-react
Free and Open Source UI Kit for Tailwind CSS and React based on Google's Material Design.
Stars: ✭ 45 (-50.55%)
Mutual labels:  tailwindcss
over-hangman
💥 Over powered hangman game
Stars: ✭ 42 (-53.85%)
Mutual labels:  tailwindcss
nextjs-typescript-mdx-blog
Next.js blog starter built with Typescript, MDX, and Tailwind CSS.
Stars: ✭ 130 (+42.86%)
Mutual labels:  tailwindcss
postcss-typed-css-classes
PostCSS plugin that generates typed entities from CSS classes for chosen programming language.
Stars: ✭ 12 (-86.81%)
Mutual labels:  tailwindcss
next-tailwind-motion
A simple Next.js starter kit with TailwindCSS (JIT) and Framer Motion preconfigured. Optional feature branches for Locomotive Scroll, Sanity and Dato configuration coming soon...
Stars: ✭ 40 (-56.04%)
Mutual labels:  tailwindcss
YATAS
Yet Another Tailwind Alpine Starter
Stars: ✭ 18 (-80.22%)
Mutual labels:  tailwindcss
grad.then
grad.then() Life after freeCodeCamp, get a job 💪
Stars: ✭ 13 (-85.71%)
Mutual labels:  styled-components
guillaumebriday.fr
✏️ 📖 My personal blog built with Gatsby and Tailwind CSS.
Stars: ✭ 27 (-70.33%)
Mutual labels:  tailwindcss
Limg
An image hosting service powered by Laravel
Stars: ✭ 41 (-54.95%)
Mutual labels:  tailwindcss
sketch-style-to-react-native
Sketch plugin that copies an element's styles in React Native way directly to your Mac clipboard.
Stars: ✭ 37 (-59.34%)
Mutual labels:  reactnative
eslint-plugin-tailwind
ESLint rules for Tailwind CSS
Stars: ✭ 97 (+6.59%)
Mutual labels:  tailwindcss

React Native Whirlwind 🌪️

A utility-first CSS framework designed for React Native.

Total Downloads Latest Release License


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!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].