
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
tw-styler
- Tailwind CSS with Styled Components for React Native and WebNote: To use
tw-styler
, Tailwind CSS must be properly set up in your project. Follow the Tailwind CSS Installation Guide to install and configure Tailwind CSS first.
A utility-first library that combines Tailwind CSS with Styled Components for both React Native and Web applications. It allows you to create highly customizable components with dynamic styles, including support for Tailwind utility classes.
npm
For React Native:
npm install tw-styler/native
For Web:
npm install tw-styler/web
import React from 'react';
import { Text, View } from 'react-native';
import tailwindStyled from 'tw-styler/native'; // Import for React Native
const Container = tailwindStyled(View)<{ isChecked?: boolean; isCorrect?: boolean }>`
flex-1
justify-center
align-items: center;
border-width: 2px;
border-color: ${({ isChecked, isCorrect }) =>
!isChecked ? 'gray' : isCorrect ? 'green' : 'red'};
`;
const App = () => {
return (
<Container isChecked={true} isCorrect={false}>
<Text style={{ color: 'white' }}>This container has dynamic styles</Text>
</Container>
);
};
export default App;
import React from 'react';
import { Text } from 'react-native';
import tailwindStyled from 'tw-styler/web'; // Import for Web
const Container = tailwindStyled('div')<{ isChecked?: boolean; isCorrect?: boolean }>`
flex
justify-center
items-center
border-width: 2px
border-color: ${({ isChecked, isCorrect }) =>
!isChecked ? 'gray' : isCorrect ? 'green' : 'red'}
`;
const App = () => {
return (
<Container isChecked={true} isCorrect={false}>
<Text style={{ color: 'white' }}>This container has dynamic styles</Text>
</Container>
);
};
export default App;
border-color
, margin
, padding
, etc.).This library is fully typed for TypeScript. The tailwindStyled
function and props are type-safe.
Feel free to fork this repository and submit pull requests. Ensure that your changes include tests and proper documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Tailwind CSS with Styled Components for React Native and Web
The npm package tw-styler receives a total of 1 weekly downloads. As such, tw-styler popularity was classified as not popular.
We found that tw-styler demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.