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

stailwc

v0.17.0

Published

An experimental transpiler to bring tailwind macros to SWC rocket

Readme

stailwc (speedy tailwind compiler)

This is an experimental SWC transpiler to bring compile time tailwind macros to SWC (and nextjs) a-la twin macro. The goal is to give the same great compile-time ergonomics and flexibility while performing considerably better than babel-based alternatives. Supports both emotion and styled-components for CSS-in-JS, and many build systems such as SWC, nextjs, Vite, etc.

Compatibility Chart

We are currently testing against the following versions. Other versions outside these may still work, however.

| stailwc | NextJS | Emotion | Styled Components | swc | Vite | | ------- | ------ | ------- | ----------------- | ------ | ----- | | latest | 13.4.3 | 11.10.5 | 5.3.6 | 1.3.24 | 4.1.0 |

Feature Chart

| Feature | Emotion | Styled Components | | ------------------------------- | ------- | ----------------- | | tw jsx attribute | ✅ | ✅ | | tw template tag | ✅ | ✅ | | tw component syntax | ✅ | ✅ | | tw component extension syntax | ✅ | ✅ | | Global styles | ✅ | ✅ | | Plugin parameter suggestions | ✅ | ✅ |

Getting started

> npm add -D stailwc
> yarn add -D stailwc
> pnpm add -D stailwc

To get started with NextJS, place the following in your next.config.js. For other framworks / tools, please see the examples.

next.config.js

const stailwc = require("stailwc/install");

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  experimental: {
    swcPlugins: [
      stailwc({
        engine: "emotion", // or "styled-components"
      }),
    ],
  },
  compiler: {
    emotion: true,
    // or
    styledComponents: true,
  },
};

module.exports = nextConfig;

Optionally, you can also include the tailwind normalizer + forms plugin by including the <TailwindStyle /> component. Please see the relevant examples.

_document.tsx

import { TailwindStyle } from "stailwc";

export default function App({ Component, pageProps }) {
  return (
    <>
      <TailwindStyle />
      <Component {...pageProps} />
    </>
  );
}

Types

There is one step you need to take to get types working. You need to add stailwc.d.ts to the root of your source folder.

Usage

The tw tag

You can interact with stailwc in two ways. The first is through the tw JSW attribute, and the second is via the tw template tag.

import { useState } from "react";

export const ColorButton = () => {
  const [clicked, setClicked] = useState(0);
  return (
    <button
      tw="p-1 m-4 text-green bg-white hover:(bg-gray text-yellow md:text-red) border-3"
      css={clicked % 2 == 0 ? tw`border-green` : tw`border-blue`}
      onClick={() => setClicked(clicked + 1)}
    >
      Clicked {clicked} times
    </button>
  );
};

Component syntax

You can also create styled components using the tw template tag. This will automatically create the correct syntax for both emotion and styled-components.

export const StyledButton = tw.button`p-1 m-4 text-green bg-white hover:(bg-gray text-yellow md:text-red) border-3`;
export const ShadowButton = tw(StyledButton)`shadow-lg`;

Examples

There are examples available for both emotion and styled-components. You can run them by cloning the repo and running yarn followed by yarn dev in the example directory. You will need to stailwc first.