A minimal and scalable React starter template focused on best practices and modern design patterns. This boilerplate is designed to help you build maintainable, reusable, and performant React applications with TypeScript.
- TypeScript ready with strict typings
- Atomic design principles for component organization
- React Hooks and Context API support
- Modular and scalable folder structure
- Reusable UI components: Button, Text, Container, etc.
- Utility-first styling with Tailwind CSS
- Storybook integration for isolated UI development
- Code quality tools: ESLint and Prettier
- Performance optimizations using React.memo and forwardRef
- Easily extendable for routing, state management, and API integration
- Fully integrated with Tailwind CSS for utility-first styling
- Supports custom theming via CSS variables for colors, fonts, and spacing
- Enables fast, consistent styling while maintaining a scalable, maintainable design system
- Node.js (>=14.x)
- npm or yarn package manager
git clone https://github.com/connect-bilal/react-design-patterns-starter.git
cd react-design-patterns-starter
npm install
# or
yarn install- π§ Update global styles and themes in
src/styles/ - π¨ Modify or extend atomic components in
src/common/ - π§± Create new features using the pre-defined folder structure and design patterns
- π Check the Storybook documentation to explore available components and see usage examples for each one
| Package | Description |
|---|---|
react |
The core library for building UI components. |
react-dom |
React DOM bindings for rendering to the browser. |
react-router-dom |
Declarative routing for React applications. |
react-helmet |
Manage document head for SEO optimization. |
clsx |
Utility for conditionally joining class names. |
react-icons |
Popular icons (FontAwesome, Material, etc.) as React components. |
| Package | Description |
|---|---|
vite |
Fast, modern build tool with native ESM support. |
@vitejs/plugin-react |
Vite plugin for React. |
vite-tsconfig-paths |
Supports TypeScript path aliases in Vite. |
typescript |
TypeScript language support. |
| Package | Description |
|---|---|
prettier |
Opinionated code formatter. |
eslint-config-prettier |
Disables ESLint rules that conflict with Prettier. |
eslint-plugin-import |
Linting support for ES6+ import/export syntax. |
eslint-plugin-jsx-a11y |
Accessibility linting for JSX elements. |
eslint-plugin-react |
Linting for React components and patterns. |
eslint-plugin-react-hooks |
Ensures correct usage of React Hooks. |
eslint-plugin-react-refresh |
ESLint rules for React Fast Refresh. |
eslint-plugin-storybook |
Storybook-specific linting rules. |
| Package | Description |
|---|---|
vitest |
Vite-native unit testing framework. |
@vitest/browser |
Browser-based testing support. |
@vitest/coverage-v8 |
Coverage reports using V8 instrumentation. |
playwright |
End-to-end testing with modern browser support. |
| Package | Description |
|---|---|
@storybook/react |
Main Storybook package for React. |
@storybook/react-vite |
Vite integration with Storybook. |
@storybook/addon-essentials |
Core set of useful addons. |
@storybook/experimental-addon-test |
Integrates tests with stories. |
@storybook/blocks |
Visual layout and component blocks. |
@storybook/test |
Addon to run automated tests on stories. |
@chromatic-com/storybook |
Visual testing and deployment with Chromatic. |
| Package | Description |
|---|---|
husky |
Manage Git hooks easily (e.g., pre-commit hooks). |
lint-staged |
Run linters only on staged files. |
- β React 19 with TypeScript
- β‘ Vite for blazing-fast development and builds
- π ESLint + Prettier + Husky + Lint-Staged
- π§ͺ Vitest + Playwright for testing
- π SEO-ready with
react-helmet - π Storybook for component development
- π¦ Organized folder structure based on best practices
src/
βββ assets/ # Static assets like images, fonts, icons, and svgs
βββ components/ # Reusable UI components following Atomic Design principles
β βββ common/ # Base-level atomic components (Button, Text, Container)
β β βββ Alert/ # Alert component
β β βββ Button/ # Button component
| β β βββ Button.tsx # Main Button component
β β β βββ Button.types.ts # Props types / interfaces
β β β βββ Button.styles.ts # Tailwind style definitions
β β β βββ Button.stories.ts # Storybook story
β β β βββ index.ts # Re-export for cleaner imports
β β βββ Container/ # Container/layout component
β β βββ Divider/ # Divider component
β β βββ Input/ # Reusable input field component
β β βββ Label/ # Label component
β β βββ Link/ # Styled wrapper for internal and external links
β β βββ Text/ # Text/typography component
β β βββ Icon/ # Icon component with SVG support
β β βββ Link/ # Link component with external/internal support
β β βββ SEO/ # SEO component to manage meta tags (Open Graph, Twitter, etc.)
β β βββ Toggle/ # Toggle component for switch or checkbox functionality
β β βββ ThemeSwitcher/ # Wrapper component using Toggle & ThemeContext
β β βββ TruncateText/ # Truncates long text with "Less" and "More" toggle support
β βββ hoc/ # Higher-Order Components
β ββββββ index.ts # Central re-export
β βββ layouts/ # Reusable layout wrappers and page structures (e.g. Page, AppShell)
β βββ index.ts # Central re-export of layout components
β βββ Page/ # Page layout component for consistent page structure
βββ constants/ # Application-wide constants, enums, and configuration values
βββ context/ # Global app state with React context
β βββ ThemeContext.tsx # Theme context (light/dark toggle)
β |ββ index.ts # Contexts export
βββ hooks/ # Custom React hooks for shared logic across app
β βββ useTheme.ts # Manages light/dark theme state and toggle logic
β βββ useTitle.ts # Sets and updates the document title dynamically
β βββ useWindowWidth.ts # Tracks and returns current window width (responsive utility)
β βββ index.ts # Central export file for all custom hooks
βββ i18n/ # Localization files and i18n config (e.g., en.json, fr.json)
βββ lib/ # Library modules & integrations (API clients, services)
β |ββ index.ts # Library export
βββ pages/ # Route-level components (pages/screens)
βββ services/ # API calls, business logic
βββ store/ # State management (Redux, Zustand, or Context)
βββ styles/ # Global styles, theme files, and CSS Modules
β βββ global.css # Base styles, CSS resets, and global styling
β βββ theme.css # Theme-related styles (e.g., light and dark mode overrides)
β βββ utilities.css # Custom Tailwind utility classes and overrides for extended styling
β βββ token.ts # Design tokens and reusable style constants (colors, spacing, typography, state classes)
βββ types/ # TypeScript type definitions and interfaces
βββ utils/ # Utility functions and helpers (formatting, API calls, etc.)
β βββ capitalize.ts # Capitalize the first letter of a string
β βββ clamp.ts # Clamp a number between a min and max
β βββ isClient.ts # Check if code is running in a browser environment
β βββ isValidLiteral.ts # Validate if a value matches allowed literals (e.g., enums)
β βββ mergeRefs.ts # Combine multiple refs into one
β βββ truncate.ts # Shorten text with ellipsis based on limit
β βββ uuid.ts # Generate a unique identifier
β βββ index.ts # Central export for all utility functions
βββ App.tsx # Root application component
βββ index.tsx # Application entry point, rendering <App />
Explore the live Storybook documentation to see the components in action, following the React Design Patterns used in this project:
π View Storybook
Q: Can I remove components I donβt need?
A: To remove unused components, simply delete their folder inside src/components/common/ and remove their export from
src/components/common/index.ts.
Q: Can I use this starter for commercial projects?
A: Absolutely! This starter is free to use and modify for personal or commercial projects. Just please donβt redistribute it as your own starter template.
This React starter template is provided free of charge for building personal or commercial products and applications.
β You MAY:
- Use this project to build your own app or product
- Modify the code as needed
- Share your own built products
β You MAY NOT:
- Resell, redistribute, or republish this project as a starter template, boilerplate, or development kit
- Claim ownership of the original project structure for educational or starter purposes
Contact me for approval if you wish to use it as a base for another starter/template.
- Author:
Bilal Ahmad Khan - Email:
[email protected]
π§ Work in Progressβ¦ Stay tuned!