Vite-React-TypeScript-Tailwind-CSS-Extension-Boilerplate Tailwind Templates

Vite React Typescript Tailwind Css Extension Boilerplate

A powerful, feature-rich boilerplate for building cross-browser extensions using React, TypeScript, Tailwind CSS, and Vite. Designed for modern web development with first-class developer experience.

Modern Browser Extension Boilerplate

A powerful, feature-rich boilerplate for building cross-browser extensions using React, TypeScript, Tailwind CSS, and Vite. Designed for modern web development with first-class developer experience.

๐ŸŒŸ Key Features

Cross-Browser Support

  • ๐ŸŒ Multi-Browser Compatibility
    • Chrome/Chromium-based browsers (v3 manifest)
    • Firefox (v2 manifest)
    • Safari
    • Edge
    • Brave

Modern Tech Stack

  • โšก Vite for lightning-fast development
  • โš›๏ธ React 19 with latest features
  • ๐Ÿ”ท TypeScript for type safety
  • ๐ŸŽจ Tailwind CSS with custom UI components
  • ๐ŸŽญ Shadcn/ui components integration

Developer Experience

  • ๐Ÿ”ฅ Hot Module Replacement (HMR) for instant updates
  • ๐Ÿงช Type-safe messaging system between extension components
  • ๐Ÿ› ๏ธ Browser API abstraction layer for unified development
  • ๐Ÿ“ฆ Manifest generation per browser
  • ๐Ÿ” ESLint + Prettier configuration
  • ๐ŸŽฏ Path aliases for clean imports

Extension Features

  • ๐Ÿ”Œ Content Scripts with TypeScript support
  • ๐ŸŒ Background Service Worker
  • ๐ŸชŸ Popup Interface with React
  • ๐Ÿ’พ Storage API abstraction
  • ๐Ÿ“จ Message passing utilities
  • ๐Ÿ”’ Permission handling

๐Ÿš€ Quick Start

# Clone the repository
git clone https://github.com/hirendhola/Vite-React-TypeScript-Tailwind-CSS-Extension-Boilerplate.git
# Install dependencies
npm install

# Development
npm run dev:chrome    # Chrome development
npm run dev:firefox   # Firefox development
npm run dev:safari    # Safari development
npm run dev:all      # Develop for all browsers

# Building
npm run build:chrome   # Build for Chrome
npm run build:firefox  # Build for Firefox
npm run build:safari   # Build for Safari
npm run build:all     # Build for all browsers

# Packaging
npm run pack:all      # Create distribution packages

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ components/       # Reusable UI components
โ”‚   โ””โ”€โ”€ ui/          # Shadcn/ui components
โ”œโ”€โ”€ lib/             # Utility functions
โ”‚   โ”œโ”€โ”€ browser-api.ts   # Browser API abstraction
โ”‚   โ””โ”€โ”€ utils.ts     # Helper functions
โ”œโ”€โ”€ popup/           # Extension popup interface
โ”œโ”€โ”€ content/         # Content scripts
โ”œโ”€โ”€ background/      # Service worker
โ””โ”€โ”€ manifest/        # Browser-specific manifests

๐Ÿ› ๏ธ Development Features

Hot Module Replacement

  • Instant updates for popup and content scripts
  • Preserves state during development
  • Automatic reloading when needed

Browser API Abstraction

// Unified API calls across browsers
import browserAPI from '@/lib/browser-api';

// Works in Chrome, Firefox, and Safari
await browserAPI.storage.local.set({ key: 'value' });
await browserAPI.tabs.query({ active: true });

Type-Safe Messaging

// Type-safe message passing between components
browserAPI.runtime.sendMessage({
  type: 'ACTION_TYPE',
  payload: data,
});

UI Components

  • Pre-configured Shadcn/ui components
  • Custom theme support
  • Dark/Light mode
  • Responsive design

๐Ÿ“ฆ Building and Distribution

Automated Builds

  • Browser-specific manifest generation
  • Optimal bundle splitting
  • Source map generation
  • Asset optimization

Distribution Packages

  • Automatically generates ZIP files for store submission
  • Separate builds for each browser
  • Development and production configurations

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

Top categories

Loading Svelte Themes