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

next-yak

v9.4.2

Published

next-yak is a CSS-in-JS solution tailored for Next.js that seamlessly combines the expressive power of styled-components syntax with efficient build-time extraction of CSS using Next.js's built-in CSS configuration

Downloads

55,552

Readme

next-yak

A yak Riding on a rusty SWC Rocket

npm version License

next-yak is a build-time CSS-in-JS library powered by a Rust SWC plugin. Write styled-components syntax, get zero-runtime CSS extraction and full React Server Components compatibility.

Works with Next.js (Webpack & Turbopack), Vite (7+, including Vite 8 with OXC), and Storybook. Any Vite-based framework works out of the box, including react-router, TanStack Start, and more.

Production-proven: next-yak is sponsored and used in production by Digitec Galaxus, the largest e-commerce platform in Switzerland, across thousands of styled components, delivering measurable improvements in Core Web Vitals.

Features

  • Multi-Framework: First-class support for Next.js (Webpack & Turbopack), Vite 7+ (react-router, TanStack Start, ...), and Storybook
  • Build-Time CSS: Extracts CSS at compile time with zero runtime overhead
  • React Server Components: Works seamlessly with both Server and Client Components
  • Cross-File Imports: Import constants, mixins, and selectors from .yak files and other modules, works across all bundlers
  • Standard CSS Syntax: Write familiar CSS with full nesting, keyframes, and media query support
  • Integrates with Atomic CSS: Combines with utility-first frameworks like Tailwind CSS
  • TypeScript First: Fully typed props, theme context, and cross-file selectors
  • Lightweight Runtime: Minimal footprint, just swaps CSS class names based on props
  • Minimal Dependencies: Only 8 dependencies in total (including transitive ones)

Documentation

Full documentation, guides, and a live playground are available at yak.js.org.

Compatibility

| next-yak | Next.js | Vite | react | swc_core | | -------- | --------- | --------------- | ----------- | -------- | | 9.x | >= 16.1.0 | >= 7.0.0 (9.1+) | 19.x | 56.0.0 | | 8.x | >= 16.0.0 | - | 19.x | 45.0.1 | | 7.x | >= 15.4.4 | - | 19.x | 38.0.1 | | 6.x | >= 15.4.1 | - | 19.x | 27.0.6 | | 5.x | >= 15.2.1 | - | 19.x | 16.0.0 | | 4.x | >= 15.0.4 | - | 19.x | 5.0.1 | | 3.x | 15.x | - | 18.x / 19.x | 3.0.2 | | 2.x | 14.x | - | 18.x / 19.x | 0.279.0 |

Installation

npm install next-yak

Quick Start

Next.js

// next.config.ts
import { withYak } from "next-yak/withYak";

export default withYak({
  // your next.js config
});

Vite

// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { viteYak } from "next-yak/vite";

export default defineConfig({
  plugins: [viteYak(), react()],
});

Usage

import { styled } from "next-yak";

const Button = styled.button`
  background: #bf4f74;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
`;

License

next-yak is licensed under the MIT License.

Contributing

Contributions are welcome! The contributing guide helps you get started.