A modern, production-ready skeleton for building Chrome Extensions using React, Vite, CRXJS, and Manifest V3.
- ⚛️ React powered Popup, Options, Side Panel, and Content Scripts.
- ⚡ Instant HMR (Hot Module Replacement) for all extension parts.
- 📦 Manifest V3 compliant.
- 🛠 Vite powered build system.
- 🧩 Examples included:
- Popup: Counter demo with React State & storage sync.
- Options: Settings page with React forms.
- Background: Service Worker with alarms.
- Content Script: React component injection into Shadow DOM.
- Side Panel: Persistent React view.
src/
├── action/ # Popup (React Root)
├── options/ # Options Page (React Root)
├── sidepanel/ # Side Panel (React Root)
├── content/ # Content Script (React Injection)
├── background/ # Service Worker (Pure JS)
└── assets/ # Icons
npm installnpm run devThis will start the Vite dev server.
- Open Chrome and go to
chrome://extensions. - Enable Developer mode.
- Load the
distfolder. - CRXJS Note: Changes to React components will HMR automatically.
npm run buildGenerates a production-ready build in the dist folder.
- Popup: Click the extension icon. The counter state persists using
chrome.storagehooks. - Options: Right-click > Options. Change the color preference.
- Content Script: Visit any website. A floating "React Extension Active" widget appears in the bottom right.