Install typescriptcss with Next.js
typescriptcss is a zero-runtime CSS-in-JS library. You write styles as inline chains directly on your elements, and the build plugin collects them into a stylesheet with hashed class names.
The Next.js adapter configures both Turbopack and webpack so the same setup works in development and production.
Install typescriptcss
Install the runtime package and the Next.js adapter.
Add the plugin to your config
Wrap your Next.js configuration with the typescriptcss adapter.
Write your styles inline
Import the utilities you need and build a chain, then call it to produce the style object. No class names or separate CSS file are required.
Compose states and breakpoints
Insert dark, sm, md, or lg anywhere in the chain to scope the styles after it. Everything stays in the same expression.
Run the build
Run the Next.js production build. The adapter transforms application source files and injects the collected styles.