Nextron: Next.js and Electron Desktop Framework
Nextron pairs Next.js with Electron so a team that already writes React and TypeScript can ship a desktop app without learning Electron's raw main-process APIs first. The README pins an exact version table between Next.js and Nextron releases, which keeps upgrades predictable instead of trial and error. Reach for it if your stack is already Next.js; skip it if you need a smaller binary than Electron produces or server-side rendering at runtime.
What is Nextron?
Nextron is an open-source framework, maintained at saltyshiomix/nextron, that scaffolds an Electron app around a Next.js renderer so the interface runs on ordinary web code. A project splits into a main-process folder and a renderer folder, where Next.js builds as a static export before Electron loads it, and electron-builder handles the macOS, Windows, and Linux packaging step.
Key Features and Integrations
- โA direct Next.js-to-Nextron version table in the README: Next.js v16.x pairs with Nextron v10.x, v14.x-v16.x with v9.x, v12.x-v13.x with v8.x, down through v6.x pairing with Nextron v1.x.
- โESM support added in v10: set package.json's type field to module, switch next.config.js to export default, and replace __dirname with import.meta.dirname across the codebase.
- โProject scaffolding through create-nextron-app, with example templates covering with-tailwindcss, with-material-ui, with-chakra-ui, with-ant-design, with-emotion, and with-next-i18next.
- โA custom webpack config for the main process via nextron.config.ts, including overrides for mainSrcDir and rendererSrcDir.
- โDevelopment CLI flags: --renderer-port to change the Next.js dev server port (default 8888), --run-only to suppress main-process hot reload, --startup-delay to wait for the renderer, and --electron-options to pass raw Electron flags like --no-sandbox.
- โPer-platform build flags for packaging: --mac, --mac --universal, --linux, --win --ia32, --win --x64, plus --no-pack to skip electron-builder packaging.
- โA custom Babel config for the main process through a .babelrc with the nextron/babel preset.
Getting Started with Nextron
There's no separate install step. create-nextron-app scaffolds the whole project in one command: `npx create-nextron-app my-app --example with-tailwindcss`, or the yarn/pnpm equivalents (`yarn create nextron-app my-app --example with-tailwindcss`, `pnpm dlx create-nextron-app my-app --example with-tailwindcss`). Swap the --example value for any bundled template, including basic-lang-javascript, basic-lang-typescript, and with-chakra-ui. The README doesn't state a minimum Node.js version, so check that separately against whichever Next.js version you're pairing it with.
Development and Production Builds
Development mode is one script: set package.json's dev entry to `nextron`, and `npm run dev` launches the Electron window with the Next.js dev server already wired up for hot reload. Production works the same way - set the build entry to `nextron build`, and `npm run build` outputs packaged bundles into the dist folder. Under the hood, Nextron's own next.config.ts forces `output: 'export'` since Electron needs static files, switches distDir to ../app in production, sets trailingSlash so home.tsx becomes home/index.html, and turns off Next's image optimization because it doesn't work with a static export. Platform builds go through flags: `nextron build --mac`, `--mac --universal`, `--linux`, `--win --ia32`, `--win --x64`, and a macOS binary has to be built on macOS itself. Packaging is handled by electron-builder.yml, which sets appId, productName, the output directory, and which files ship; point to a different config with --config, or skip packaging entirely with --no-pack.
Example Nextron Applications
- โขBuilding a Tailwind-styled desktop app off the with-tailwindcss example instead of wiring Tailwind into Electron by hand.
- โขShipping an app that launches from a custom URL protocol, using the basic-launch-app-from-url example - the README notes this one only works in a production build.
- โขStarting a desktop app that needs to persist local data, using basic-store-data as the base instead of building storage from zero.
- โขDropping in Ant Design, Chakra UI, Material UI, or Emotion straight from the matching example folder rather than configuring each UI kit manually.
- โขLocalizing a desktop app's interface with the with-next-i18next example when the product needs more than one language.
Strengths
- โA version table that states exactly which Next.js release pairs with which Nextron release, instead of leaving compatibility to trial and error.
- โA dozen example templates ship with create-nextron-app, covering common UI kits and patterns, so a new project starts from working code.
- โOne command for development: `npm run dev` launches Electron with the Next.js dev server already connected.
- โCLI flags cover real packaging needs: per-platform build flags, a --no-pack escape hatch, and --electron-options for raw Electron flags like --no-sandbox.
- โMIT license, with a named maintainer list in the README rather than a single point of failure.
Current Limitations and Considerations
- โณThe README doesn't document a minimum Node.js version, a test suite, or CI status, so runtime compatibility is something you verify yourself against the Next.js/Nextron version table.
- โณBuilding a macOS binary requires a macOS host machine, per the README's own build notes - there's no cross-compiling a Mac target from Linux or Windows.
- โณThe static-export requirement means no Next.js server-side rendering, no API routes at runtime, and no built-in image optimization for the renderer.
- โณUpgrading between major versions isn't automatic: moving from v9 to v10 means renaming main/background.ts to main/main.ts and changing the package.json main field by hand.
- โณThe README links to a 'Looking for maintainers' discussion, worth noting for the project.
Alternatives for Desktop Development
Frequently Asked Questions
Nextron is an open-source framework, maintained at saltyshiomix/nextron, that combines Next.js and Electron so a web developer can build a desktop app with React and TypeScript instead of Electron's raw APIs.
Run `npx create-nextron-app my-app --example with-tailwindcss`, or the yarn/pnpm equivalents, swapping the --example value for any bundled template like basic-lang-typescript or with-chakra-ui.
Set package.json's dev script to `nextron` and run `npm run dev`. Nextron launches the Electron window automatically, with the Next.js dev server hot-reloading the renderer.
Set the build script to `nextron build` and run `npm run build`. Nextron outputs packaged bundles into the dist folder, using electron-builder.yml for platform packaging settings.
Nextron's README maps them directly: Next.js v16.x needs Nextron v10.x, v14.x-v16.x needs v9.x, v12.x-v13.x needs v8.x, v11.x needs v7.x, v10.x needs v6.x, v9.x needs v5.x, v8.x needs v4.x, v7.x needs v2.x-v3.x, and v6.x needs v1.x.
Nextron's build process is customizable through electron-builder.yml, which sets appId, productName, the output directory, and which files ship; --config points to an alternate file, and --no-pack skips packaging entirely.
The problem it solves
Wiring a modern frontend framework into Electron usually means writing a separate main-process entry point, configuring a bundler for it by hand, and figuring out how to load a dev server's output into a BrowserWindow versus a static build for production. Next.js adds its own wrinkle: the renderer has to run as a static export, with image optimization and server rendering turned off, before Electron can load it at all. Nextron's README frames its own reason for existing around that setup cost, describing its goal as giving developers a path to build desktop software using nothing beyond typical web skills, staying easy to pick up, and staying open to outside contributors, then folding the Next.js-to-Electron wiring into a CLI and project templates instead of a from-scratch integration every time.
Who should try it โ and who should skip
Try Nextron if your team already builds in Next.js and React and wants a desktop build without adopting a second frontend framework or hand-writing Electron's main-process boilerplate. Skip it if you need a smaller install size than Electron produces - Nextron doesn't change Electron's runtime footprint - or if your app depends on server-side rendering and API routes at runtime, since the static-export requirement rules that out.
Related repositories
Still deciding about nextron?
One click hands the question to an AI along with this page โ see what it says about nextron.
