On this page
Overview
Linaria is a zero-runtime CSS-in-JS library. It evaluates css tags and React styled APIs during the build and extracts the resulting styles into CSS files instead of shipping a runtime styling engine.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Extract css-tag styles to static CSS at build time
Styles authored with @linaria/core are processed through the WyW-based transform and emitted as CSS assets without a client-side style runtime.
Sources: [1]
Use React styled APIs with CSS custom properties for dynamic styles
@linaria/react provides styled-component-like APIs, with dynamic prop values represented through CSS custom properties.
Best fit
Fits frontends that want colocated styles without runtime CSS-in-JS cost
It is useful for React and JavaScript codebases that want CSS-in-JS ergonomics while delivering static CSS in production.
Sources: [1]
Before adoption
Linaria 8 requires Node 22.12.0 or later
Both @linaria/core and @linaria/react 8.2.0 declare Node >=22.12.0, so local and CI toolchains must be upgraded accordingly.
Official sources
- [1]Linaria 8.2.0 README(2026-10-05)
- [2]@linaria/core 8.2.0 package metadata(2026-10-05)
- [3]@linaria/react 8.2.0 package metadata(2026-10-05)
- [4]Linaria bundler integration guide(2026-10-05)
- [5]Linaria migration guide(2026-10-05)
- [6]Linaria MIT license(2026-10-05)
Supplemental curator note
Linaria 8 is built on WyW 2 and requires Node.js >=22.12.0. Older bundler packages such as @linaria/vite moved to @wyw-in-js/*, so legacy integration guides should not be reused unchanged.
Try it in 3 steps
- 1
Install Linaria 8.2.0 with the Vite integration
On Node.js 22.12.0 or later, pin Linaria core together with the matching WyW/Vite integration line.
demo=$(mktemp -d "${TMPDIR:-/tmp}/linaria.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact @linaria/core@8.2.0 @wyw-in-js/vite@2.4.0 vite@6.4.3 - 2
Create a css-tag source file and Vite config
Create the smallest setup where the WyW Vite plugin can process an
@linaria/corecss tag at build time.mkdir -p src && printf "%s\n" "import { defineConfig } from 'vite';" "import linaria from '@wyw-in-js/vite';" "export default defineConfig({ plugins: [linaria()] });" > vite.config.mjs && printf "%s\n" '<!doctype html><div id="app"></div><script type="module" src="/src/main.js"></script>' > index.html && printf "%s\n" "import { css } from '@linaria/core';" "const title = css`color: rebeccapurple; font-weight: 700;`;" "document.querySelector('#app').innerHTML = '<h1 class="' + title + '">Linaria</h1>';" > src/main.js - 3
Build with Vite and verify static CSS extraction
Confirm the production build emits a CSS asset instead of relying on a runtime styling engine.
npx vite build && test -n "$(find dist -name '*.css' -type f -print -quit)"
Growth
Growth trends · Last 30 days
12,350 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- css
- css-in-js
- css-in-react
- react
- Stars
- 12,350
- Forks
- 413
- Watchers
- 64
- Open issues
- 73
- Owner type
- Organization
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Oct 4, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- PostCSS28,974 Stars
4 shared tag(s) · 1 shared category(s) · Same language
parse CSS into an AST and compose build-time style processing with JavaScript plugins
TypeScript - React Spectrum15,913 Stars
4 shared tag(s) · 1 shared category(s) · Same language
build accessible React interfaces with styled Spectrum components or unstyled React Aria primitives
TypeScript - PurgeCSS8,050 Stars
4 shared tag(s) · 1 shared category(s) · Same language
scan content files and keep only selectors that are actually referenced
TypeScript - Bootstrap174,991 Stars
3 shared tag(s) · 2 shared category(s)
Build responsive interfaces from a CSS/Sass grid, utilities, components, and native JavaScript
MDX - Tailwind CSS97,773 Stars
3 shared tag(s) · 1 shared category(s) · Same language
Compose utility classes in HTML and components and generate the required CSS at build time
TypeScript - Docusaurus66,399 Stars
3 shared tag(s) · 1 shared category(s) · Same language
combine docs, blogs, custom React pages, and localization into a static documentation-site build
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.