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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tswind

v1.0.0-alpha-1.1

Published

Styling library for React with CSS-in-JS like api, powered by tailwindcss

Readme

tswind

tswind is a styling library for React with CSS-in-JS like api, powered by tailwindcss.

Motivation

Tailwindcss allows you to write more css rules with as less as possible amount of meaningful key strokes. E.g typing 3 characters long p-2 yields to same result with typing 14 characters long padding: 2rem;. If creating UI components is a part of our daily job, it becomes exponentially more efficient when we need to do this hundred of times in daily basis.

But not everything is for free. Having a lot of class names inside your jsx, makes it harder to focus on logic part of your component. Especially if the appeareance of an element changes based on internal state which is the case most of the time. $

Example

import { wind } from "tswind";

const Button = wind.button(
  {
    variant: {
      primary: "bg-red-100",
      secondary: "bg-transparent border-2 border-red-100",
    },
    size: {
      normal: "py-4 text-sm",
      large: "py-8",
    },
  },
  "font-bold tracking-wide px-8"
);

const Buttons = () => (
  <>
    <Button>Primary</Button>
    <Button size="large">Primary Large</Button>
    <Button variant="secondary">Secondary</Button>
    <Button variant="secondary" size="large">
      Secondary Large
    </Button>
  </>
);

Installation

npm i tswind

Prerequisites

Tailwindcss has to be set up in the project. Please follow this instructions.

Usage

Basic component

const Button = wind.button("bg-indigo-700 rounded-md shadow-md text-white");

Component with flags

const Button = wind.button(
  { variants: { primary: "bg-red-100", secondary: "bg-green-100" } },
  "px-4 py-2"
);

Extending Components

const LinkButton = wind.extend(Button).a("text-semibold");

Using Theme

const wind = createWind({
  color: {
    text: "text-gray-800",
    textDark: "text-gray-900",
  },
  bgColor: {
    primary: "bg-indigo-700",
    secodary: "bg-green-700",
  },
});

const Button = wind.button({
  variant: {
    primary: [$.color.white, $.bgColor.primary],
    secondary: "$bgColor.secondary $color.textDark",
  },
});

Extending the theme

const {
  ThemeProvider,
  useTheme,
  theme: $,
} = wind.createTheme({
  dark: {
    color: {
      text: "text-gray-100",
      textDark: "text-gray-400",
    },
    bgColor: {
      primary: "bg-green-300",
      secondary: "bg-indigo-300",
    },
  },
});

const App = () => {
  const { preferDarkMode } = useDeviceSettings();
  const [theme, setTheme] = useTheme(preferDarkMode ? "dark" : "default");
  return (
    <ThemeProvider theme={theme}>
      <Button
        onClick={() =>
          setTheme((theme) => (theme === "dark" ? "default" : "dark"))
        }
      >
        Toggle Theme
      </Button>
    </ThemeProvider>
  );
};