• Docs
  • API
  • Blog
  • Playground

Learn

IntroductionThinking in StyleX
Installation
Next.js
Vite
Vite + ReactVite + React Server ComponentsReact Router (RSC)RedwoodSDKWaku
WebpackRspackEsbuildPostCSSCLI

Styles

Defining stylesUsing styles

Themes

Defining variablesUsing variablesCreating themesTypes for Variables

Recipes

VariantsContext-driven stylesVariables for descendant stylesReset ThemeMerge ThemesLight and Dark Themes
Static types
API Reference

Configuration

@stylexjs/babel-plugin@stylexjs/eslint-plugin@stylexjs/postcss-plugin

JavaScript API

stylex.createstylex.propsstylex.keyframesstylex.when.*stylex.positionTrystylex.viewTransitionClassstylex.defineVarsstylex.types.*stylex.createThemestylex.defineConstsstylex.firstThatWorks

Types

StyleXStyles<>StyleXStylesWithout<>StaticStyles<>Theme<>VarGroup<>
EcosystemAcknowledgements

API Reference

Configuration

  • @stylexjs/babel-plugin
  • @stylexjs/eslint-plugin
  • @stylexjs/postcss-plugin

JavaScript API

  • stylex.create()
  • stylex.createTheme()
  • stylex.defineConsts()
  • stylex.defineVars()
  • stylex.firstThatWorks()
  • stylex.keyframes()
  • stylex.when.*()
  • stylex.positionTry()
  • stylex.props()
  • stylex.types.*()
  • stylex.viewTransitionClass()

Static types

  • type StyleXStyles
  • type StyleXStylesWithout
  • type StaticStyles
  • type Theme
  • type VarGroup
Static types@stylexjs/babel-plugin

On this page

ConfigurationJavaScript APIStatic types

Develop

  • Learn
  • API

Explore

  • Playground
  • Blog

Participate

  • GitHub
  • Acknowledgements

Legal

  • Privacy
  • Terms
Copyright © 2025 Meta Platforms, Inc.
Bluesky