Is Panda CSS Compatible with React Server Components?
Updated
Yes. Panda CSS is explicitly designed to work with React Server Components (RSC). Its homepage states that it is "RSC compatible" and "Works Everywhere. Including Server Components." The reason it works is architectural: Panda CSS generates static CSS at build time and has zero runtime, so it does not require client-side JavaScript to resolve styles. That makes it a fit for frameworks that support RSC, such as Next.js App Router.
Why RSC compatibility is possible
React Server Components render on the server and never ship their component code to the browser. A styling solution that depends on runtime JavaScript to compute styles can conflict with that model. Panda CSS avoids the problem by moving style generation to the build step:
- Build-time generation — Panda scans your source files and emits static CSS files during the build, rather than at runtime in the browser.
- Zero runtime — The generated styles are plain CSS, so server-rendered components don't need a client-side style engine.
- Type-safe authoring — You write styles in TypeScript, and Panda turns them into CSS classes and static output.
Because the output is static CSS, a Server Component can use Panda's style functions or JSX helpers without pulling a styling runtime into the client bundle.
What this looks like in practice
Panda offers several authoring styles, and the docs show them side by side. For example, a style function approach:
import { css } from "./styled-system/css";
import { circle, stack } from "./styled-system/patterns";
function App() {
return (
<div className={stack({ direction: "row", p: "4" })}>
<div className={circle({ size: "5rem", overflow: "hidden" })}>
<img src="https://via.placeholder.com/150" alt="avatar" />
</div>
<div className={css({ mt: "4", fontSize: "xl", fontWeight: "semibold" })}>
John Doe
</div>
</div>
);
}
Or a JSX component approach:
import { Box, Stack, Circle } from "./styled-system/jsx";
function App() {
return (
<Stack direction="row" p="4" rounded="md" shadow="lg" bg="white">
<Circle size="5rem" overflow="hidden">
<img src="https://via.placeholder.com/150" alt="avatar" />
</Circle>
<Box mt="4" fontSize="xl" fontWeight="semibold">
John Doe
</Box>
</Stack>
);
}
Both produce static CSS at build time, which is what keeps them compatible with server rendering.
Setup basics
The documented install command is:
npm i -D @pandacss/dev
Panda is installed as a dev dependency because it runs at build time. After installation you configure it and run its codegen step so the styled-system directory (used in the imports above) is generated. The homepage points to a "Get Started" entry and "Browse Guides" for the full setup flow.
Conditions to check before adopting
The compatibility claim is general, but your specific stack still matters. Before committing:
- Confirm your framework version supports the RSC model you intend to use, and check Panda's docs for any framework-specific guidance.
- Run the codegen step as part of your build so the generated
styled-systemoutput exists before your app compiles. - Verify your build pipeline picks up the generated CSS and includes it in the server-rendered output.
Panda also supports multi-variant styling through recipes, shown in the docs with cva:
import { styled } from "./styled-system/jsx";
import { cva } from "./styled-system/css";
export const badge = cva({
base: { fontWeight: "medium", borderRadius: "md" },
variants: {
status: {
default: { color: "white", bg: "gray.500" },
success: { color: "white", bg: "green.500" },
},
},
});
export const Badge = styled("span", badge);
This is still resolved to static CSS at build time, so it doesn't reintroduce a runtime dependency.
Bottom line
Panda CSS is compatible with React Server Components because it generates static CSS at build time with zero runtime. If you're using a framework that supports RSC, Panda is a reasonable candidate — just confirm your framework version and complete the codegen and build configuration steps before relying on it.