Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
react-native-whirlwind
Advanced tools
Whirlwind is a utility-first CSS 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.
A utility-first CSS framework designed for React Native.
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.
React Native has a little-known 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 and that's exactly what Whirlwind does.
Install react-native-whirlwind using npm
or yarn
:
# Using npm
npm install react-native-whirlwind@alpha
# Using yarn
yarn add react-native-whirlwind@alpha
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 createTheme()
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 we 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.
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>Welcome to Whirlwind</Text>
</View>
)
}
For full documentation, visit https://arabold.github.io/react-native-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 Whilehirlow was born.
If you're using it in your project and like to see it listed here, please let me know!
FAQs
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.
The npm package react-native-whirlwind receives a total of 33 weekly downloads. As such, react-native-whirlwind popularity was classified as not popular.
We found that react-native-whirlwind demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.