A modern, opinionated template for building browser extensions with WXT, React, TypeScript, Tailwind CSS, and shadcn/ui components.
- ⚡ Built with WXT - The next-gen browser extension framework
- ⚛️ React 19 with TypeScript for type safety
- 🎨 Tailwind CSS for utility-first styling
- ✨ shadcn/ui components for beautiful, accessible UI
- 🎭 Dark mode support
- 🔥 Hot reloading for development
- 📦 Optimized production builds
-
Clone the repository (or
Use this template)git clone https://github.com/husniadil/wxt-react-tailwind-shadcn-template.git cd wxt-react-tailwind-shadcn-template -
Install dependencies
pnpm install
-
Configure Chrome for Testing
⚠️ Important: This template requires Chrome for Testing. Regular Chrome/Chromium installations are not supported.- Download Chrome for Testing from: https://googlechromelabs.github.io/chrome-for-testing/#stable
- Extract the downloaded archive
Create a
web-ext.config.tsfile in the root directory with the following content, updating the path to point to your Chrome for Testing binary:import { defineWebExtConfig } from "wxt"; // For Mac ARM users: export default defineWebExtConfig({ binaries: { chrome: "/path/to/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", }, }); // For Windows users (uncomment and modify as needed): // export default defineWebExtConfig({ // binaries: { // chrome: "C:\\path\\to\\chrome-win64\\chrome.exe" // }, // });
💡 Note: The exact path will vary based on your OS and where you extracted Chrome for Testing.
-
Start development server
pnpm run dev
-
Build for production
pnpm run build
.
├── public/ # Static assets
│ ├── icon/ # Extension icons in various sizes
├── screenshots/ # Extension screenshots
├── src/
│ ├── app/ # App content / business logic
│ ├── assets/ # Static assets used in the application
│ ├── components/ # Reusable React components
│ │ ├── settings/ # Settings components
│ │ └── ui/ # shadcn/ui components
│ ├── constants/ # Application constants
│ ├── context/ # React context providers
│ ├── data/ # Dummy data
│ ├── entrypoints/ # Extension entry points
│ │ ├── background/ # Background script
│ │ ├── content/ # Content scripts
│ │ └── popup/ # Popup UI
│ ├── hooks/ # Custom hooks
│ ├── lib/ # Utility functions
│ ├── styles/ # Global styles and CSS
│ └── types/ # TypeScript type definitions
├── .eslint.config.js # ESLint configuration
├── components.json # shadcn/ui configuration
├── package.json # Project manifest
├── postcss.config.mjs # PostCSS configuration
├── tsconfig.json # TypeScript configuration
├── web-ext.config.ts # web-ext configuration
└── wxt.config.ts # WXT configuration
- Uses Tailwind CSS for utility-first styling
- Custom themes and styles can be added in
src/styles/globals.css - Dark mode is enabled by default and can be toggled using the
useThemehook
To add new shadcn/ui components:
- Run the component addition command:
pnpm dlx shadcn@latest add [component-name]
- Import and use the component in your React components
MIT


