Top 12+ Battle-Tested React Boilerplates for 2024
Tags: react, frontend, webdev, javascript
Published: 2024-04-29 18:52:13

## The matter of choosing the most popular web framework to start

Recently, React has become one of the most beloved interface frameworks of all time. According to a 2023 survey, React.js is used by 40.58% of developers worldwide, making it [one of the most popular web frameworks](https://www.statista.com/statistics/1124699/worldwide-developer-survey-most-used-frameworks-web/). Developed by Facebook, React.js is also relied upon by other tech giants such as PayPal, Uber, Instagram, and Airbnb for their user interfaces. Undoubtedly, its widespread adoption and strong community support have been facilitated by React's combination of productivity, component-based architecture, and declarative syntax. This means developers are building projects on React more than ever before.

The React library is non-opinionated by design, meaning that "out of the box", it doesn't include practically any additional features beyond the core functionality of defining and managing components. Therefore, it's easy to mess up without knowing best practices for prop passing, decomposing, structuring React application files, scaling the application as a whole, and other nuances. These pitfalls can be avoided by using a boilerplate that contains built-in functions and configurations, providing a comprehensive foundation with core tools and libraries, optimizing the development process, and allowing developers to focus on building their application logic rather than dealing with initial setup and configuration. In other words, it serves as a standardized starting point for initiating application development. Searching for 'react-boilerplate' on GitHub yields 44.8k repositories at the moment. The question arises regarding which template to choose for development, one that fits your application and is good for scalability and future maintenance.

## Types of React boilerplates

In the past,  the most commonly used way for starting React projects was create-react-app (CRA) - a popular and officially supported boilerplate by Facebook. However, the new React documentation, published on March 16, 2023, no longer recommends CRA as the best solution for creating React programs. Let's consider the alternatives, compare them, and decide on the best way to start a project. 
By delving into the various aspects of React boilerplates, let's consider the criteria by which they can be divided:

**Libs and Configs:**

- _Minimalistic Boilerplates:_ provide basic configurations for a React project, including basic setups (such as Webpack, Babel, and ESLint). They assume that developers will add certain libraries and features as needed. The majority of boilerplates fall into this category.
- _Feature-Rich Boilerplates:_ come with pre-configured additional libraries and tools. These may include state management (e.g., Redux), routing (React Router), and testing, also may include basic UI components and pages, further speeding up development by providing common UI elements and layouts.

**Authentication and Registration:**

- _Boilerplates with Auth and Registration:_ include components for login, signup, and user sessions.
- _Boilerplates without Auth:_  leave authentication implementation to developers.

**Full-Stack vs. Frontend-Only:**

- _Full-Stack Boilerplates:_ provide a comprehensive solution for building web applications, covering both the frontend (React) and backend.
- _Frontend-Only Boilerplates:_ focus solely on the React interface. Developers need to integrate them with the desired server.

**UI Components Libraries:**

- _Boilerplates with UI Components:_ include a full set of UI components that adhere to consistent design patterns (e.g., buttons, forms, modals).
- _Boilerplates without UI Components:_ leave the development of components entirely to the developer using the boilerplate.

**Paid vs. Free:**

- _Free/Open-Source Boilerplates:_ freely available, community-supported, and often well-maintained.
- _Paid Boilerplates:_ some commercial templates offer additional features, premium support, or extended functionality.

Based on the above classification, it can be said that the most popular React boilerplates, such as Vite, Create React App (CRA), Create Next App, Razzle, include only the basic libraries and configurations necessary to start developing with React (Minimalistic Boilerplates).

## React template selection criteria

Deciding which boilerplate to use during development can be quite challenging because it's not just about creating an application but also about scaling and maintaining it afterward. So how to choose the appropriate solution from the given variety of existing boilerplates, and how do you choose them in general? Here are the key points we suggest paying attention to when choosing a boilerplate to start your project:

- _Support and Maintenance Options:_ Is the project regularly updated?
- _Performance Scores_
- _Code Quality_ (structure cleanliness, scalability, code organization)
- _Production Readiness:_ Is the project ready for production use right now?
- _Availability of features_ such as authentication, routing, internationalization, form handling, testing, basic pages, and UI components - the list could go on, you just need to determine which ones are needed for your project implementation and look for them in the boilerplate.

## React Project Scaffolding Tools

The initial step in developing React applications typically involves choosing among Vite, Create React App, Create Next App, or Razzle as the foundation. They provide framework-like functionality, particularly regarding setting up the initial project structure, configuring build tools, and providing development servers.

[<u>**Vite**</u>](https://vitejs.dev/) focuses on providing an extremely fast development server and workflow speed in web development. It uses its own ES module imports during development, speeding up the startup time.

[<u>**Create React App (CRA)**</u>](https://create-react-app.dev/) abstracts away the complexity of configuring Webpack, Babel, and other build tools, allowing developers to focus on writing React code. It includes features such as hot module reloading for efficient development.

[<u>**Next.js**</u>](http://Next.js) is a React framework for building server-rendered and statically generated web applications. It configures Next.js projects with sensible defaults, including features like server-side rendering (SSR), file-based routing, and API routes.

[<u>**Razzle**</u>](https://razzlejs.org/) is a build tool created by Airbnb, which also simplifies server-side rendering. It abstracts away the complexity of configuring server-side rendering settings and allows developers to easily create versatile JavaScript applications. Razzle supports features like code splitting, CSS-in-JS, and hot module replacement, making it suitable for building React applications that require server-side rendering.

The above-mentioned build tools are often referred to as React boilerplates. Since they only abstract the complexities of setup away, provide basic configurations, and optimize build workflows, they are not very functional and do not contain additional features themselves. Therefore, according to the classification provided above, we classify them as **Minimal Boilerplates**. Essentially, they often serve as boilerplate templates, that is, they are great tools for creating more feature-rich React boilerplates.

## Table of selected Boilerplates

Next, we will consider React boilerplates that do not charge a license fee and/or offer their features for money and also take into account the date of the last update (not more than six months ago). Based on this, we have taken into consideration 12 boilerplates*:

<table>
<tr>
<th></th>
<th>Stars</th>
<th>Contributors</th>
<th>Last Commit Date</th>
<th>Open Issues</th>
<th>About</th>
</tr>


<tr>
<td><a href="https://github.com/brocoders/extensive-react-boilerplate">extensive-react-boilerplate</a></td>
<td>148</td>
<td>8 contributors, supported and used by <a href="https://brocoders.com/">Brocoders</a></td>
<td>16-04-2024</td>
<td>2</td>
<td>Extensive React Boilerplate: <br />✔️NextJS ✔️Auth ✔️I18N ✔️MUI ✔️Forms<br />
<a href="https://react-boilerplate-coral.vercel.app/">demo</a></td>
</tr>

<tr>
<td><a href="https://github.com/kriasoft/react-starter-kit">React Starter Kit</a></td>
<td>22.5k</td>
<td>5 contributors</td>
<td>15-02-2024</td>
<td>2</td>
<td>The web's popular Jamstack front-end template for building web applications with React<br />
<a href="https://github.com/kriasoft/react-starter-kit">demo</a></td>
</tr>

<tr>
<td><a href="https://github.com/gilbarbara/react-redux-saga-boilerplate">react-redux-saga-boilerplate</a></td>
<td>606</td>
<td>6 contributors</td>
<td>06-02-2024</td>
<td>-</td>
<td>Starter kit with react-router, react-helmet, redux, redux-saga and styled-components<br />
<a href="https://redux-saga.react-boilerplate.com/">demo</a></td>
</tr>

<tr>
<td><a href="https://github.com/ixartz/Next-js-Boilerplate">Next-js-Boilerplate</a></td>
<td>7k</td>
<td>24 contributors</td>
<td>05-04-2024</td>
<td>1</td>
<td>Boilerplate and Starter for Next.js 14+ with App Router/Page Router, Tailwind CSS 3.4, TypeScript<br />
<a href="https://nextjs-boilerplate.com/">demo</a></td>
</tr>

<tr>
<td><a href="https://github.com/Adrinlol/landy-react-template">landy-react-template</a></td>
<td>1.1k</td>
<td>1 contributor</td>
<td>06-04-2024</td>
<td>4</td>
<td>Landy is an open-source React landing page template designed for developers and startups<br />
<a href="https://landy-web.netlify.app/">demo</a></td>
</tr>

<tr>
<td><a href="https://github.com/eruptionjs/core">core</a></td>
<td>307</td>
<td>6 contributors</td>
<td>27-03-2024</td>
<td>6</td>
<td>Boilerplate for React/Typescript, built based on Vite</td>
</tr>

<tr>
<td><a href="https://github.com/hadrysm/nextjs-boilerplate">nextjs-boilerplate</a></td>
<td>127</td>
<td>1 contributor</td>
<td>18-03-2024</td>
<td>-</td>
<td>Next.js 14+ boilerplate with typescript, husky, lint-staged, eslint, prettier, jest, react-testing-library, storybook, ghaction and plop<br />
<a href="https://nextjs-boilerplate-hadrysm.vercel.app/">demo</a></td>
</tr>

<tr>
<td><a href="https://github.com/suren-atoyan/react-pwa">react-pwa</a></td>
<td>501</td>
<td>6 contributors</td>
<td>09-01-2024</td>
<td>8</td>
<td>Starter kit for modern web applications<br />
<a href="https://react-pwa.surenatoyan.com/">demo</a></td>

<tr>
<td><a href="https://github.com/wtchnm/Vitamin">Vitamin</a></td>
<td>485</td>
<td>5 contributors</td>
<td>06-04-2024</td>
<td>1</td>
<td>Opinionated Vite starter template<br />
<a href="https://vitamin-wtchnm.vercel.app/">demo</a></td>

<tr>
<td><a href="https://github.com/mickasmt/next-saas-stripe-starter">next-saas-stripe-starter</a></td>
<td>722</td>
<td>1 contributor</td>
<td>02-04-2024</td>
<td>-</td>
<td>An open-source SaaS Starter built using Next.js 14, Prisma, Planetscale, Auth.js v5, Resend, React Email, Shadcn/ui, Stripe and Server Actions<br />
<a href="https://next-saas-stripe-starter.vercel.app/">demo</a></td>

<tr>
<td><a href="https://github.com/sungik-choi/gatsby-starter-apple">gatsby-starter-apple</a></td>
<td>132</td>
<td>3 contributors</td>
<td>01-04-2024</td>
<td>-</td>
<td>Gatsby blog starter kit with beautiful responsive design<br />
<a href="https://gatsby-starter-apple.netlify.app/">demo</a></td>

<tr>
<td><a href="https://github.com/sungik-choi/gatsby-starter-apple">fullstack-typescript</a></td>
<td>359</td>
<td>7 contributors</td>
<td>28-03-2024</td>
<td>3</td>
<td> FullStack React with TypeScript starter kit</td>
</table>
* as of April 2024

## Comparison of boilerplates by features

Now let's take a closer look at the features developers can get from using boilerplates and what else needs to be taken into account:
**API Integration:** Some templates may contain configurations for integrating with specific APIs or server services.
**State Management Solutions:** Options like Redux, MobX, Recoil, or built-in React state management. Also, it's hard to ignore asynchronous React Query.
**Testing Configuration:** Predefined testing setups or none of them at all.
**Authentication and Authorization:** Whether user authentication and authorization are prescribed and how they are handled, in particular, whether there is integration with certain authentication libraries;
**Internationalization (i18n) and Localization:** Providing the ability to support  multiple languages using libraries like react-i18next or react-intl.
**ESLint Rules Compliance:** Allows not only to detect or fix problems during code formatting but also to identify potential bugs.
**Styling Solutions:** The solution for using CSS modules, styled-components, or UI libs, which will ensure easy and effective reuse of styled components.
**Type Safety in the Project:** Using TypeScript to provide static typing during development, utilizing classes or modules to create more scalable and reliable applications.
**App Theme Selection:** Allowing users to switch between light and dark themes based on their preferences or automatic settings.
**Ready-made Form Components:** Providing components intended for reuse across forms, reducing code duplication, and promoting standardization. They may also include built-in validation and error handling, making development more reliable.
**UI Component Libraries:** Offering ready-made and customizable components, such as buttons and modal windows, that developers can easily integrate into their applications, saving time and effort on designing and coding these elements from scratch.
We analyzed each boilerplate and obtained the following table:

<table>
  <thead>
    <tr>
   <th></th>
   <th><a href="https://github.com/brocoders/extensive-react-boilerplate">extensive-react-boilerplate</a></th>
   <th><a href="https://github.com/kriasoft/react-starter-kit">React Starter Kit</a></th>
<th><a href="https://github.com/gilbarbara/react-redux-saga-boilerplate">react-redux-saga-boilerplate</a></th>
<th><a href="https://github.com/ixartz/Next-js-Boilerplate">Next-js-Boilerplate</a></th>
<th><a href="https://github.com/Adrinlol/landy-react-template">landy-react-template</a></th>
<th><a href="https://github.com/eruptionjs/core">core</a></th>
<th><a href="https://github.com/hadrysm/nextjs-boilerplate">nextjs-boilerplate</a></th>
<th><a href="https://github.com/suren-atoyan/react-pwa">react-pwa</a></th>
<th><a href="https://github.com/wtchnm/Vitamin">Vitamin</a></th>
<th><a href="https://github.com/mickasmt/next-saas-stripe-starter">next-saas-stripe-starter</a></th>
<th><a href="https://github.com/sungik-choi/gatsby-starter-apple">gatsby-starter-apple</a></th>
<th><a href="https://github.com/sungik-choi/gatsby-starter-apple">fullstack-typescript</a></th>
</tr>
</thead>
<tbody>
<tr>
   <td>Documentation</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>+-</td>
   <td>-</td>
</tr>
<tr>
   <td>Authentication features</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Social sign in</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Internationalization</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>User profile</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Forms</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Statement management</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Tests</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>UI components</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Eslint</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
</tr>
<tr>
   <td>Paid</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
   <td>Styled-components</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
</tr>
<tr>
   <td>TypeScript</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
</tr>
<tr>
   <td>Themes</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>+</td>
   <td>-</td>
</tr>
<tr>
   <td>UI Component</td>
   <td>Material ui</td>
   <td>Material ui</td>
   <td>gilbarbara/ components</td>
   <td>-</td>
   <td>antd</td>
   <td>-</td>
   <td>Tailwind CSS</td>
   <td>Material ui</td>
   <td>Tailwind CSS</td>
   <td>@radix-ui</td>
   <td>-</td>
   <td>Material ui</td>
</tr>
  </tbody>
</table>

## Description of boilerplates from the table

**[Extensive-react-boilerplate](https://github.com/brocoders/extensive-react-boilerplate)**. This React boilerplate is designed for all types of projects. It's not only fully compatible with the backend boilerplate [nestjs-boilerplate](https://github.com/brocoders/nestjs-boilerplate) but also stands as an independent solution, which is one of its main advantages. This template offers a wide range of functionalities, such as:

- User authentication and authorization, including the possibility of using Google or Facebook accounts.
- Page private or public access settings.
- ESLint setup with custom rules to enhance code efficiency and cleanliness.
- Type safety to ensure the reliability of the written code.
- Project localization using a custom useLanguage hook.
- E2E testing support.
- Light or Dark Mode at the discretion of the user.
- A library of controlled components based on MUI, integrated with react-hook-form by default.  So, no longer a need to spend extra time connecting input fields to controllers.
- State management using React Query for handling asynchronous operations.
- User management functionalities (CRUD).
- Avatar selection and upload feature with dropzone capability.
- Support for Next.js framework (SSR) for improved application performance and SEO optimization.

As you can see, from the above mentioned features, this boilerplate significantly reduces the startup time for your project ([approximately 193 hours](https://bcboilerplates.com/)), making it a worthwhile consideration.

_Categories:_ Feature-Rich Boilerplates, Boilerplates with Auth and Registration, Frontend-Only (and has a fully compatible [backend boilerplate](https://github.com/brocoders/nestjs-boilerplate), thus can be used as  Full-Stack Boilerplates), Free.

**[React-starter-kit](https://github.com/kriasoft/react-starter-kit)**. A template for creating web applications based on React. It comes with pre-configured setups such as CSS-in-JS, Vitest, VSCode settings, Cloudflare support, and SSR. A connection to Firestore is used as a database.  It includes implementations of some UI components like a toolbar or sidebar based on Joy UI.

_Categories:_ Feature-Rich Boilerplates, Boilerplates with Auth and Registration, Frontend-Only, Free.

**[React-redux-saga-boilerplate](https://github.com/gilbarbara/react-redux-saga-boilerplate)**. A starter project for creating a React application that uses Redux for state management. It provides support for Unit and End 2 End Testing, react-helmet, and uses the Emotion library for styling, simplifying CSS styling with JavaScript. It includes custom components like a header or footer implemented using styled functionality.

_Categories:_ Feature-Rich Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[Next-js-Boilerplate](https://github.com/ixartz/Next-js-Boilerplate)**. This boilerplate has a flexible code structure where you only need to select and save the necessary functionality. It supports integration with Tailwind CSS, authentication with Clerk, and is compatible with SQLite, PostgreSQL, and MySQL databases. Unit testing is done using Jest, and the Zod library is used for describing validation schemas.

_Categories:_ Feature-Rich Boilerplates, Boilerplates with Auth and Registration, Frontend-Only, Free.

**[Landy-react-template](https://github.com/Adrinlol/landy-react-template)**. This boilerplate comes with multilingual support, smooth animations, and all content is stored in JSON files, allowing users to manage texts without prior knowledge of React.js. Contains a set of its own components (button, input, textarea, etc.) created based on styling HTML elements using styled-components.

_Categories:_ Feature-Rich Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[Core](https://github.com/Adrinlol/landy-react-template)**. A modern template was developed based on the fast project creation tool — Vite. It supports TypeScript for type safety and includes good configurations for ESLint, Prettier, CommitLint, Husky, and Lint-Staged.

_Categories:_ Minimalistic Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[Nextjs-boilerplate](https://github.com/hadrysm/nextjs-boilerplate)**. This React boilerplate uses Next.js for static page generation. It supports git message convention, component generation using Plop, and uses Tailwind CSS for styling organization. Has its Storybook for component documentation.

_Categories:_ Minimalistic Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[React-pwa](https://github.com/suren-atoyan/react-pwa)**. A ready-made set to start your project from scratch. It consists of a minimalistic combination of core libraries, components, and utilities typically needed by developers when creating React applications. It contains its own HOC for error handling on the page and is developed based on Vite.

_Categories:_ Feature-Rich Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[Vitamin](https://github.com/wtchnm/Vitamin)**. A starter project containing Tailwind CSS with a basic style reset and a Prettier plugin that automatically organizes your classes. For testing, tools such as Vitest, Testing Library, and Cypress are used, but it does not include React UI Component Libraries.

_Categories:_ Minimalistic Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[Next-saas-stripe-starter](https://github.com/mickasmt/next-saas-stripe-starter)**. By using this boilerplate, you can extend the capabilities of your project with features like Next.js, Prisma, Planetscale, Auth.js v5, Resend, React Email, Shadcn/ui, and Stripe. It includes a library of components built using Radix UI and Tailwind CSS.

_Categories:_ Feature-Rich Boilerplates, Boilerplates with Auth and Registration, Full-Stack Boilerplates, Free.

**[Gatsby-starter-apple](https://github.com/sungik-choi/gatsby-starter-apple)**. A template for creating applications with a nice responsive design and contains animations for a mobile menu. The basis for styling the used components is styled-components. The boilerplaite supports search engine optimization well and has RSS feed capabilities.

_Categories:_ Minimalistic Boilerplates, Boilerplates without Auth, Frontend-Only, Free.

**[Fullstack-typescript](https://github.com/gilamran/fullstack-typescript)**. This boilerplate is a full-stack application for quickly launching your project. It has a library of custom components based on Material UI, and axios is used for client-server communication. It does not support certain state management technologies like Redux, MobX, etc.

_Categories:_ Minimalistic Boilerplates, Boilerplates without Auth, Full-Stack Boilerplates, Free.

## Peculiarities of implementation of some features

In general, React templates offer various implementation features aimed at speeding up and standardizing the development process. They include UI Component Libraries and encompass a general approach to styling, state management, and basic ESLint configurations.

### React UI Component Libraries

The implementation of functionalities in React boilerplates often revolves around modular development, where components are designed to be reusable and composable. Analyzing current libraries and according to this article, the following can be considered the most popular ones:

![blocks with listed UI Libraries](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dt2ors84nvpelp4u1r5k.png)
We can say for sure, Material UI is currently the most popular library with 91.2k GitHub stars and more than 3 million weekly downloads. Thanks to its responsive web design (RWD) feature, you can be confident that your application will automatically adapt to various screens and devices.

### Styling Solutions

Styling solutions such as CSS modules, styled-components, or Sass are usually included in React boilerplates. They offer different approaches to styling components, providing flexibility and scalability while maintaining component encapsulation.

Advantages of using styled-components as a styling solution:

- The library automatically tracks components rendered on the page and applies only their styles.
- Automatically generates a unique class name for styles, ensuring no errors in class names.
- Styles are attached to specific components, simplifying the removal of CSS itself.
- Effortless dynamic styling (code examples below belong to [bc-boilerplates](https://bcboilerplates.com/))

```
const AvatarInputContainer = styled(Box)(({ theme }) => ({
  display: "flex",
  position: "relative",
  flexDirection: "column",
  alignItems: "center",
  padding: theme.spacing(2),
  marginTop: theme.spacing(2),
  border: "1px dashed",
  borderColor: theme.palette.divider,
  borderRadius: theme.shape.borderRadius,
  cursor: "pointer",

  "&:hover": {
    borderColor: theme.palette.text.primary,
  },
}));
```
- Using dynamic props of a component during styling. This ensures that the style is updated based on the value of the variable. 

```
const StyledCollapseBtn = styled("button")<ICollapse>(({ isOpen, theme }) => ({
  justifySelf: "flex-end",
  color: COLOURS.black,
  backgroundColor: "transparent",
  border: "none",
  cursor: "pointer",
  paddingLeft: theme.spacing(2.5),
  position: "absolute",
  bottom:theme.spacing(3),
  left: isOpen ? "150px" : "unset",
}));
```
- This allows for the reuse of styles from one component to another or for influencing one component over another (parent-child relationship).

```
const Link = styled.a`
display: flex;
align-items: center;
padding: 5px 10px;
background: papayawhip;
color: #BF4F74;
`;

const Icon = styled.svg`
flex: none;
transition: fill 0.25s;
width: 48px;
height: 48px;
  
${Link}:hover & {
  fill: rebeccapurple;
}
`;
```


### State Management

State management is another important aspect that simplifies application state handling, providing scalability and maintainability, especially in complex applications. Usually, Redux, MobX, and Zustand come to mind when choosing a state management tool. However, they are client-side libraries, and compared to a tool like React Query, their application for storing asynchronous data may not be as efficient.

React Query is a server-state library used in some boilerplates like [bc-boilerplates](https://bcboilerplates.com/). It is responsible not only for managing asynchronous operations between the server and the client but also provides ready-to-use functionality for searching, caching, and updating data in React and Next.js applications. With just a few lines of code, React Query replaces the boilerplate code used to manage cached data in your client state. 

### ESLint Rules in Boilerplates

The efficiency of using ESLint rules during the development of your project is also manifested in writing custom rules. Since ESLint has extensive functionality and flexibility, you can create not only formatting and rules but also consider internal project decisions. For example, working with forms, it is possible to control and warn developers about possible unnecessary renders, incorrect solutions when working with objects, or simply point out unused imports. For example, [extensive-react-boilerplate](https://github.com/brocoders/extensive-react-boilerplate) addresses such issues as follows:

- warn about rules regarding incorrect usage of patterns

```

      {
        "selector": "ConditionalExpression[consequent.type=Literal][consequent.value=true][alternate.type=Literal][alternate.value=false]",
        "message": "Do not use \"condition ? true : false\". Simplify \"someVariable === 42 ? true : false \" to \"someVariable === 42\""
      },
      {
        "selector": "JSXElement[openingElement.name.property.name=Provider] JSXElement[openingElement.name.name]",
        "message": "Do not put your regular components inside Context \".Provider\". Create new component, for example ComponentProvider. Put Provider's logic to ComponentProvider. Render \"{children} instead of regular component. Wrap regular component via new ComponentProvider \". Example: \"src/services/auth/auth-provider\""
      },
      {
        "selector": "Property[key.name=/^(padding|margin|paddingLeft|paddingRight|paddingTop|paddingBottom|paddingVertical|marginLeft|marginRight|marginTop|marginBottom|marginVertical)$/][value.type=/^(Literal|UnaryExpression)$/]:not([value.value=\"0 !important\"]):not([value.value=\"0\"]):not([value.value=\"0 auto\"]):not([value.value=\"auto\"])",
        "message": "Use theme.spacing() instead of literal."
      },
      {
        "selector": "CallExpression[callee.name=/^(useQuery|useInfiniteQuery)$/] Property[key.name=queryKey]:not(:has(Identifier[name=key]))",
        "message": "Use key created via createQueryKeys function instead of your solution"
      },
      {
        "selector": "CallExpression[callee.name=refresh]",
        "message": "Do not use refresh() function for update or change result in react-query. Use \"queryClient.resetQueries\" or pass new filter data to queryKey."
      },
      {
        "selector": "ExpressionStatement[expression.callee.object.name=JSON][expression.callee.property.name=parse][expression.arguments.0.callee.object.name=JSON][expression.arguments.0.callee.property.name=stringify]",
        "message": "Do not use JSON.parse(JSON.stringify(...)) for deep copy. Use structuredClone instead."
      }
```
- inform about the possibility of uncontrolled renders

```

      {
        "selector": "VariableDeclaration[declarations.0.init.callee.name=useForm] ~ VariableDeclaration[declarations.0.init.callee.name=useFieldArray]",
        "message": "\"useFieldArray\" in main form component (which use \"useForm\") will re-render the whole form component. Move your useFieldArray's logic to separate component."
      },
      {
        "selector": "VariableDeclaration[declarations.0.init.callee.name=useForm] ~ VariableDeclaration[declarations.0.init.callee.name=useController]",
        "message": "\"useController\" in main form component (which use \"useForm\") will re-render the whole form component. Move your useController's logic to separate component."
      },
      {
        "selector": "VariableDeclaration[declarations.0.init.callee.name=useForm] ~ VariableDeclaration[declarations.0.init.callee.name=useFormContext]",
        "message": "\"useFormContext\" in main form component (which use \"useForm\") will re-render the whole form component. Move your useFormContext's logic to separate component."
      },
      {
        "selector": "VariableDeclaration[declarations.0.init.callee.name=useForm] ~ VariableDeclaration[declarations.0.init.callee.name=useFormState]",
        "message": "\"useFormState\" in main form component (which use \"useForm\") will re-render the whole form component. Move your useFormState's logic to separate component."
      },
      {
        "selector": "CallExpression[callee.name=useForm][arguments.length=0], CallExpression[callee.name=useForm][arguments.length=1]:not(:has(Property[key.name=defaultValues]))",
        "message": "Pass object with \"defaultValues\" for correct \"formState\" behavior. More info here: https://react-hook-form.com/api/useform/formstate#main"
      }
```


## Conclusion

The choice of an effective React template is crucial for the success of your project. Instead of reinventing the wheel, leveraging the power of a well-chosen boilerplate can significantly speed up your development process and create a solid foundation. When selecting a boilerplate, we recommend familiarizing yourself with its directory structure and configuration files to understand its underlying foundation, ease of integration, modularity, and maximum alignment with technical requirements. Consider whether the available features can provide the functions you need. This can save development time and potentially offer well-maintained and tested code.

Since there was often a question of how to apply multiple boilerplates simultaneously due to the lack of comprehensive functionality in such templates, the [bc-boilerplates](https://bcboilerplates.com/) team proposed a solution in the form of the [extensive-react-boilerplate](https://github.com/brocoders/extensive-react-boilerplate). In our opinion, it can carve out its niche among well-known counterparts and become a worthy competitor deserving of your attention. We invite you to try it out and look forward to your feedback in the form of a new star.

Full credits for this article to [Olena Vlasenko](https://github.com/ElenVlass) and [Liudmyla Kostenko](https://github.com/LiudmylaKostenko)🇺🇦