A modern, production-ready template for building high-performance web applications with Vite and HeroUI v2. This template provides a solid foundation with best practices, TypeScript support, and a comprehensive development setup.
- β‘ Lightning Fast - Powered by Vite for instant hot module replacement
- π¨ Modern UI Components - Beautiful, accessible components with HeroUI v2
- π§ TypeScript Ready - Full TypeScript support for better developer experience
- π Smooth Animations - Framer Motion integration for fluid interactions
- π± Responsive Design - Mobile-first approach with Tailwind CSS
- π― Developer Experience - Optimized tooling and configuration
- π Hot Reload - Instant feedback during development
| Technology | Purpose | Version |
|---|---|---|
| Vite | Build tool & dev server | Latest |
| HeroUI | UI component library | v2 |
| Tailwind CSS | Utility-first CSS framework | Latest |
| Tailwind Variants | Component variants utility | Latest |
| TypeScript | Type-safe JavaScript | Latest |
| Framer Motion | Animation library | Latest |
- Node.js 18+
- npm, yarn, pnpm, or bun
-
Clone the repository
git clone https://github.com/virtualharsh/code-image.git cd code-image -
Install dependencies
Using npm:
npm install
Using yarn:
yarn install
Using pnpm:
pnpm install
Using bun:
bun install
-
Start development server
npm run dev
-
Open your browser
Navigate to
http://localhost:5173to see your application running.
If you're using pnpm, add the following to your .npmrc file in the project root:
public-hoist-pattern[]=*@heroui/*Then reinstall dependencies:
pnpm installThis ensures HeroUI components are properly hoisted and accessible.
vite-template/
βββ public/ # Static assets
βββ src/
β βββ components/ # Reusable UI components
β βββ pages/ # Application pages
β βββ styles/ # Global styles
β βββ utils/ # Utility functions
β βββ App.tsx # Main application component
β βββ main.tsx # Application entry point
βββ index.html # HTML template
βββ package.json # Dependencies and scripts
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
npm run type-check |
Run TypeScript compiler check |
Customize your theme by modifying the HeroUI configuration in your Tailwind config:
// tailwind.config.js
const { heroui } = require("@heroui/theme");
module.exports = {
content: [
// ... your content paths
"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}"
],
theme: {
extend: {},
},
plugins: [heroui({
themes: {
light: {
colors: {
// customize your light theme
}
},
dark: {
colors: {
// customize your dark theme
}
}
}
})],
}Create new components using HeroUI's component library:
import { Button, Card, CardBody } from "@heroui/react";
export const MyComponent = () => {
return (
<Card>
<CardBody>
<Button color="primary">
Click me
</Button>
</CardBody>
</Card>
);
};- Push your code to GitHub
- Connect your repository to Vercel
- Deploy automatically on every push
- Build your project:
npm run build - Upload the
distfolder to Netlify
npm run buildUpload the contents of the dist folder to your hosting provider.
- Vite Documentation
- HeroUI Documentation
- Tailwind CSS Documentation
- TypeScript Documentation
- Framer Motion Documentation
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
- HeroUI Team for the amazing component library
- Vite Team for the blazing fast build tool