# StyleX

> The expressive, type-safe, composable, predictable and themeable styling system for ambitious interfaces

Source: https://talira.ai/catalog/stylex-cqw1r35s
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [libraries / css in js](https://talira.ai/categories/libraries/css-in-js)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source under MIT.
- Free tier: yes[^1]
- Self-hostable: yes
- Backed by: [Meta](https://talira.ai/orgs/meta.md)
- Funding: public company (NASDAQ:META)[^2]

StyleX is Meta's JavaScript syntax and compiler for styling web apps: you define styles as objects with `stylex.create()` next to your components and apply them with `stylex.props()`, and at compile time it turns them into a static file of collision-free atomic CSS, whose size levels off as the codebase grows, leaving only a tiny runtime that merges class names. The last style applied wins for each property, so styles compose predictably without specificity fights, and every style is typed, so components can declare which styles they accept. Variables, themes, light and dark modes, keyframes and view transitions are defined with `defineVars`, `createTheme` and related APIs. It works with [Next.js](https://talira.ai/catalog/next-js-2chrxyc7.md), [Vite](https://talira.ai/catalog/vite-2kbqmjmm.md), webpack, Rspack, esbuild, PostCSS and a CLI, mostly with [React](https://talira.ai/catalog/react-a48drvqv.md), and is MIT-licensed.

## Links

- Website: https://stylexjs.com/
- GitHub: https://github.com/meta/stylex
- Docs: https://stylexjs.com/docs/learn/

## Problems it solves

- our CSS bundle keeps growing with every feature and nobody dares delete old styles
- styles from different components override each other unpredictably because of specificity
- type-check which styles a React component accepts as props
- write styles in JavaScript next to components but ship a static CSS file with no runtime style engine
- define themes and design token variables that can be overridden for part of the page
- merge and conditionally apply styles with plain JavaScript expressions and know which one wins
- atomic CSS without memorising utility class names
- lint our styling code for invalid properties and values

## Features

- stylex.create and stylex.props: object styles defined next to components
- compile-time generation of a static, collision-free atomic CSS file
- last applied style wins for each property; arbitrary styles merge and compose
- typed styles: components can accept or restrict style props (StyleXStyles, StyleXStylesWithout)
- variables, constants and themes with defineVars, defineConsts and createTheme
- light and dark themes, context-driven styles with stylex.when
- keyframes, view transition classes and position-try fallbacks
- Babel plugin, PostCSS plugin, unplugin (Vite, webpack, Rspack, esbuild) and a CLI
- ESLint plugin

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.42 out of 1.
Signals: backing 0.55, extensibility 0.20.

- backed by Meta
- funding: public company (NASDAQ:META)

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [styled-components](https://talira.ai/catalog/styled-components-97cxpqhn.md): Fast, expressive styling for React. Server components, client components, streaming SSR, React Native, all one API.
- [Emotion](https://talira.ai/catalog/emotion-cdf86k4g.md): CSS-in-JS library designed for high performance style composition
- [Panda CSS](https://talira.ai/catalog/panda-css-tqftwdj6.md): Universal, type-safe, CSS-in-JS framework for design systems
- [vanilla-extract](https://talira.ai/catalog/vanilla-extract-f6hkm8zf.md): Zero-runtime Stylesheets-in-TypeScript
- [Tailwind CSS](https://talira.ai/catalog/tailwind-css-wfchsr5n.md): Rapidly build modern websites without ever leaving your HTML.
- [goober](https://talira.ai/catalog/goober-bq3mcays.md): A less than 1KB css-in-js solution

## Sources

[^1]: https://github.com/meta/stylex/blob/main/LICENSE (checked 23 Nov 2026)
[^2]: https://data.sec.gov/submissions/CIK0001326801.json (checked 20 Nov 2026)
