Compile-time extraction
Style objects defined with `stylex.create()` are statically analyzed and extracted into a single CSS file at build time, not computed in the browser.
Alternatives
AgentMail
Gives AI agents inboxes so they can send and act on email.
Grok Bot
Always-on AI teammates that get their own cloud computer, sign into your tools, and finish multi-step work on their own.
Is Agentic
Score how ready a website is for AI agents, then get evidence and recommendations to improve it.
Make This Better
Triage feedback. Ship improvements. Build a better product
StyleX is Meta's compile-time CSS-in-JS styling system for React and other component frameworks. Instead of shipping a runtime style engine, it statically extracts the styles you write as JavaScript objects into a single static CSS file at build time, then uses a tiny runtime just to merge class names at render — the authoring ergonomics of writing styles in JavaScript with close to the performance profile of hand-written static CSS. It's open source and maintained by Meta, with its source published on GitHub under facebook/stylex.
Style objects defined with `stylex.create()` are statically analyzed and extracted into a single CSS file at build time, not computed in the browser.
Define named style objects with `stylex.create()`, then apply and conditionally compose them at render with `stylex.props()`.
Generates atomic class names designed so styles never unintentionally collide, with stylesheet size that plateaus as the codebase grows instead of scaling with component count.
Composing multiple style objects follows a simple last-applied-wins rule, avoiding CSS specificity conflicts.
Official integrations for Webpack, Rspack, Esbuild, PostCSS, Vite, and Next.js.
Works with React, SolidJS, Preact, and Vue.
stylex.create({...}) — plain JS objects describing style rules, grouped into named style objects.stylex.props(...), e.g. <div {...stylex.props(styles.root, isActive && styles.active)} /> — conditionally composing multiple style objects is a first-class pattern.<style> tags, since the styling itself is already compiled CSS.Free