Create StyleX App
The fastest way to start a new StyleX project is with @stylexjs/create:
npm create @stylexjs my-appThis 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-appPick a template up front:
npm create @stylexjs my-app -- --framework nextjsUse a custom template:
npm create @stylexjs my-app -- --template github:user/repo/templateSkip dependency installation:
npm create @stylexjs my-app -- --no-installYou can also run the package directly:
npx @stylexjs/create my-app --framework vite-reactIncluded 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:
cd my-app- start the dev server with the script generated by the template
- use the matching guide in the Installation section if you want to customize the setup further