Bamboo CSS

Bamboo CSS

Build-time, type-safe, zero-runtime CSS-in-JS that compiles style calls into atomic classes

Open Source

Gallery

About Bamboo CSS

Bamboo CSS is a CSS-in-JS library that does all of its work at build time. You write styles in TypeScript with functions like css() and cva(), a Rust based extractor built on Oxc scans your source, and a Vite plugin compiles every style call into shared atomic classes. Nothing runs in the browser to compute styles, and the class names that ship are the minimum needed. It started as a fork of Panda CSS and keeps a deliberately smaller API surface.

The problem it targets is the cost that runtime CSS-in-JS quietly adds. Styles computed on the client mean extra JavaScript, extra work on every render, and stylesheets padded with tokens, keyframes and reset rules nobody uses. Bamboo's answer is to refuse the runtime path entirely. It rejects style calls it can't analyse statically, which sounds strict until you realise it's the only way to guarantee that zero-runtime is a property of the build rather than an option you hope people follow. The extractor being written in Rust on top of Oxc matters for large codebases, where scanning tens of thousands of call sites on every build would otherwise be the slow step, and Contra's codebase is the reference point, since the library was built to serve one of that size.

Setting it up means installing the dev and Vite packages, running the init command to create a config, and adding the plugin to your Vite setup. From there the CLI generates a typed styled-system authoring surface, so tokens, recipes and patterns are checked by the TypeScript compiler and a misspelled colour token is a build error rather than a silent miss. The API covers css() for inline styles, cva() and sva() for recipes with variants, cx() for composition, and pattern helpers such as flex, grid and center. Because everything resolves at build time, the tool can prune unused tokens, keyframes and reset rules, and the project reports CSS reductions of 36 to 78 percent on its example apps, with one going from 18,032 bytes to 3,959.

Authoring happens against generated code. The config file declares your tokens, breakpoints, recipes and patterns, the CLI writes a styled-system directory with typed functions that reflect it, and your components import from there. That's what makes the type safety real rather than cosmetic. The compiler knows every valid token, so a colour that isn't in the theme or a variant that doesn't exist fails the build, and configuration mistakes surface during compilation instead of as a missing style in production. Runtime fallback doesn't exist, so every value has to be resolvable ahead of time.

It's for frontend teams shipping production apps who already like the ergonomics of Panda style APIs but want a stricter, leaner compiler behind them. Component library maintainers get a typed authoring surface that documents itself through the generated code. Framework support runs through Vite and covers React, Vue, Nuxt, Solid, Svelte, Astro, Preact, React Router, Qwik and Storybook. The library came out of Contra, where it's used in production across more than 20,000 css() call sites, which is a meaningful signal for a project this young.

Where it differs from the field is the combination of a Rust extractor and an uncompromising stance. Most CSS-in-JS tools let you fall back to runtime styling when static analysis fails. Bamboo treats that as an error. The result is faster extraction, smaller CSS, and a guarantee that the runtime dependency is genuinely zero, at the cost of some flexibility in how dynamic your styles can be.

Getting started is short. Install the two packages, run npx bamboo init to scaffold the config, register the Vite plugin, and start writing css() calls. Storybook is supported through the same Vite integration, so component libraries can document themselves without a second styling path. The project openly acknowledges its Panda CSS roots, which also means much of the mental model transfers if your team has used Panda before.

The constraints follow from the design. Vite is required, so projects on webpack or other bundlers can't use it today. The native extractor ships for macOS, glibc Linux and Windows x64, which covers most machines but not every CI image. And the API is intentionally smaller than Panda's, so migrating a codebase that leans on the parts Bamboo dropped will take work. It's also early, with a small community and a short public history.

Access is open source under the MIT licence. The packages are on npm, the source and documentation are on GitHub and bamboocss.com, and there's no paid tier or hosted service involved. Issues and contributions go through the GitHub repository.

Key Features

  • Build-time compilation with a Rust Oxc extractor
  • Type-safe tokens, recipes and patterns
  • Atomic CSS output with shared classes
  • Pruning of unused tokens, keyframes and resets
  • css, cva, sva and cx APIs
  • Vite integration for most frameworks

Pros & Cons

What we like

  • Zero runtime is enforced, not optional
  • Reported 36 to 78 percent smaller CSS on example apps
  • Proven in production at Contra across 20,000 plus call sites
  • MIT licensed with familiar Panda style APIs

Room for improvement

  • Requires Vite, no other bundlers
  • Rejects styles it can't analyse statically
  • Smaller API than Panda, so migration takes work
  • Young project with a small community

Frequently Asked Questions

What is Bamboo CSS?
Bamboo CSS is a build-time, type-safe CSS-in-JS library. A Rust extractor built on Oxc scans your source, a Vite plugin compiles style calls into shared atomic classes, and no styling code runs in the browser.
Is Bamboo CSS free?
Yes. It's open source under the MIT licence, installed from npm, with source and docs on GitHub and bamboocss.com. There's no paid tier.
How is it different from Panda CSS?
It began as a fork of Panda CSS but keeps a smaller API and refuses runtime fallback, rejecting any style call it can't analyse at build time. It also prunes unused tokens, keyframes and reset rules from the output.
Which frameworks and bundlers does it support?
Vite is required. Through Vite it supports React, Vue, Nuxt, Solid, Svelte, Astro, Preact, React Router, Qwik and Storybook. The native extractor runs on macOS, glibc Linux and Windows x64.

Best For

Cutting CSS bundle size on a Vite React appEnforcing zero-runtime styling across a large codebaseMigrating from Panda CSS to a stricter compilerCatching invalid design tokens at build time

Featured in

Alternatives to Bamboo CSS

Reviews (0)

No reviews yet

Be the first to share your experience with Bamboo CSS

Sign in to write a review

Badge builder

Add Bamboo CSS to your website

Choose a badge style and size, preview it here, then copy the generated HTML. Badge images are self-contained SVGs and do not require an external script.

Bamboo CSS badge preview
<a href="https://toolindex.net/tools/bamboo-css?ref=badge" target="_blank" rel="noopener">
  <img src="https://toolindex.net/badge/bamboo-css/medium.svg" alt="Bamboo CSS - Listed on Tool Index" width="180" height="50" />
</a>

How to use the badge

  1. 1. Pick the style, size, and theme that fit your layout.
  2. 2. Copy the generated HTML from the code block.
  3. 3. Paste it into your footer, homepage, or press page.

Standard badge available

The standard listing badge is available now. Score and circle badges are limited to tools currently ranked in the top 10 of a category.

Badge clicks return visitors to this profile with a referral tag so the source remains identifiable.