Create StyleX App

The fastest way to start a new StyleX project is with @stylexjs/create:

npm create @stylexjs my-app

This scaffolds a new project from an official template, installs dependencies, and sets up StyleX with a working compiler pipeline.

Common commands

Use the interactive prompt:

npm create @stylexjs my-app

Pick a template up front:

npm create @stylexjs my-app -- --framework nextjs

Use a custom template:

npm create @stylexjs my-app -- --template github:user/repo/template

Skip dependency installation:

npm create @stylexjs my-app -- --no-install

You can also run the package directly:

npx @stylexjs/create my-app --framework vite-react

Included templates

The bundled templates currently cover common setups including:

  • Next.js
  • Vite + React
  • Vite (vanilla)
  • Webpack
  • Rollup
  • esbuild
  • Rspack
  • React Router
  • Waku
  • Vite + React Server Components
  • RedwoodSDK
  • Storybook
  • CLI-only setups

After scaffolding

Once the project is created:

  1. cd my-app
  2. start the dev server with the script generated by the template
  3. use the matching guide in the Installation section if you want to customize the setup further