React Component Naming Conventions: A Practical Guide

When you build an internal support dashboard, component names often start simple: card, list, data, and button. A few weeks later, the same React application has dozens of files, several API requests, filters, forms, and team members trying to understand what each component does.

That is where clear React component naming conventions make a real difference. Good names reduce review time, make debugging easier, and help you reuse the right UI without opening every file.

This reference guide shows how to name React components, props, event handlers, hooks, files, and folders using a practical employee directory example.

Why React Component Naming Conventions Matter

A component is a reusable JavaScript function that returns JSX, the HTML-like syntax React uses to describe a user interface. In a browser-based React application, component names tell React whether it should treat a tag as a built-in HTML element or a custom component.

For example, React reads <section> as a normal HTML element. It reads <EmployeeCard /> as a custom React component.

Clear names also show intent. Compare these two imports:

import Card from "./Card";
import List from "./List";
import Data from "./Data";

Now compare them with this version:

import EmployeeDirectory from "./EmployeeDirectory";
import EmployeeCard from "./EmployeeCard";
import EmployeeSearchInput from "./EmployeeSearchInput";

The second version explains the screen before you even read the code. This becomes especially useful when you are working on a larger application with shared UI, API integration, and several routes.

If you are still getting comfortable with how components receive values, review this guide on props in React. It helps you see why a component name and its props should describe one clear responsibility.

Use PascalCase for React Components

The main React component naming rule is simple: use PascalCase.

PascalCase means every word starts with a capital letter, with no spaces or hyphens.

function EmployeeCard() {
return <article>Employee details</article>;
}

function SupportTicketList() {
return <section>Open support tickets</section>;
}

function SalesSummaryPanel() {
return <aside>Monthly sales summary</aside>;
}

Each component starts with a capital letter, so React recognizes it as a custom component.

Avoid lowercase component names

This code looks harmless but causes a common React problem:

function employeeCard() {
return <article>Employee details</article>;
}

export default function EmployeeDirectory() {
return <employeeCard />;
}

React treats <employeeCard /> like an unknown HTML element, not like the employeeCard function. The browser may render a custom lowercase tag instead of running your component.

Write it this way instead:

function EmployeeCard() {
return <article>Employee details</article>;
}

export default function EmployeeDirectory() {
return <EmployeeCard />;
}

The EmployeeCard function and <EmployeeCard /> JSX tag now match. This is also why consistent capitalization matters when you import a component from another file.

For a closer look at this rule and common capitalization errors, see React component capitalization rules.

Name Components by Their Job

The best React component names explain what users see or what the component does. Avoid vague names such as Box, Item, Data, Main, or Component unless they are truly generic shared UI pieces.

In an employee directory, these names are easier to maintain:

Unclear nameBetter nameWhy it helps
CardEmployeeCardShows the data displayed in the card
ListEmployeeListExplains which items the list renders
FormEmployeeSearchFormShows the form’s purpose
ModalEmployeeDetailsModalIdentifies the content in the dialog
HeaderDirectoryHeaderDistinguishes it from other page headers
ButtonDeleteEmployeeButtonMakes its action obvious

A good rule is to use this pattern:

Domain + UI role

Examples include:

  • EmployeeTable
  • TicketStatusBadge
  • ProductFilterPanel
  • CustomerProfileForm
  • InvoiceDownloadButton

This approach works well in business applications because the domain word gives important context. A StatusBadge may be reusable across the whole application. A TicketStatusBadge is more specific and easier to locate when you are fixing the support dashboard.

Build a Clear Component Tree

Let’s use a small employee directory that runs in a React frontend. The screen loads employee data, allows a user to search names, and renders matching cards.

Start by giving each layer a meaningful name:

import { useState } from "react";
import EmployeeSearchInput from "./EmployeeSearchInput";
import EmployeeList from "./EmployeeList";

const employees = [
{ id: 1, name: "Aisha Khan", department: "Sales" },
{ id: 2, name: "Daniel Lee", department: "Engineering" },
{ id: 3, name: "Priya Shah", department: "Human Resources" }
];

export default function EmployeeDirectoryPage() {
const [searchTerm, setSearchTerm] = useState("");

const visibleEmployees = employees.filter((employee) =>
employee.name.toLowerCase().includes(searchTerm.toLowerCase())
);

return (
<main>
<h1>Employee Directory</h1>

<EmployeeSearchInput
searchTerm={searchTerm}
onSearchTermChange={setSearchTerm}
/>

<EmployeeList employees={visibleEmployees} />
</main>
);
}

This component is named EmployeeDirectoryPage because it represents a full route or screen. It manages state using useState, a React hook that stores values between renders. The variable searchTerm clearly describes the stored value, while visibleEmployees explains that it contains filtered results.

The child component names show their exact roles. EmployeeSearchInput collects the search text, and EmployeeList renders the results.

Name presentational components clearly

A presentational component mainly displays UI from its props. EmployeeCard is a good example.

export default function EmployeeCard({ employee }) {
return (
<article className="employee-card">
<h2>{employee.name}</h2>
<p>{employee.department}</p>
</article>
);
}

This component accepts one employee prop and displays it. Naming it EmployeeCard is stronger than naming it Card, because a future developer knows its content without inspecting the file.

import EmployeeCard from "./EmployeeCard";

export default function EmployeeList({ employees }) {
if (employees.length === 0) {
return <p>No employees match your search.</p>;
}

return (
<section className="employee-list">
{employees.map((employee) => (
<EmployeeCard key={employee.id} employee={employee} />
))}
</section>
);
}

EmployeeList owns the list rendering logic. It uses conditional rendering, which means React shows different JSX depending on a condition. If no employee matches the search, users see a useful message instead of a blank screen.

The key uses the employee’s stable id. React uses keys to track which list item changed, was added, or was removed.

Name Props After the Data They Carry

Props are values passed from a parent component to a child component. Name props after what they contain, not after generic terms like data, value, or thing.

This is difficult to read:

<EmployeeCard data={employee} />
<EmployeeList items={visibleEmployees} />

It works, but data could mean almost anything. A more readable version is:

<EmployeeCard employee={employee} />
<EmployeeList employees={visibleEmployees} />

Use singular names for one object and plural names for collections:

<EmployeeCard employee={employee} />
<EmployeeList employees={employees} />
<DepartmentFilter departments={departments} />

For Boolean props, use a name that reads like a true-or-false statement:

<EmployeeCard isSelected={true} />
<EmployeeDetailsModal isOpen={false} />
<EmployeeList hasMoreResults={true} />

Avoid unclear Boolean names such as active, show, or open when the surrounding context is missing. isDetailsModalOpen is often clearer than open.

Name Event Handler Props With on

An event handler is a function that runs after a user action, such as clicking a button or typing in an input. For props that receive event handlers, use the on prefix.

export default function EmployeeSearchInput({
searchTerm,
onSearchTermChange
}) {
return (
<label>
Search employees
<input
type="search"
value={searchTerm}
onChange={(event) => onSearchTermChange(event.target.value)}
placeholder="Enter an employee name"
/>
</label>
);
}

The prop onSearchTermChange makes its purpose clear: the parent component will handle a change to the search term. This is more descriptive than a name like update, handler, or setValue.

Use these practical patterns:

PurposeRecommended name
Click handler proponClick, onSave, onDelete
Input change handler proponSearchTermChange, onDepartmentChange
Form submit handler proponSubmit, onEmployeeCreate
Item selection handler proponEmployeeSelect, onTicketOpen
Local handler functionhandleSave, handleDelete, handleSearchChange

Here is the parent component using a named local handler:

import { useState } from "react";
import EmployeeSearchInput from "./EmployeeSearchInput";
import EmployeeList from "./EmployeeList";

export default function EmployeeDirectoryPage() {
const [searchTerm, setSearchTerm] = useState("");

function handleSearchTermChange(nextSearchTerm) {
setSearchTerm(nextSearchTerm);
}

const visibleEmployees = employees.filter((employee) =>
employee.name.toLowerCase().includes(searchTerm.toLowerCase())
);

return (
<main>
<h1>Employee Directory</h1>

<EmployeeSearchInput
searchTerm={searchTerm}
onSearchTermChange={handleSearchTermChange}
/>

<EmployeeList employees={visibleEmployees} />
</main>
);
}

I executed the above example code and added the screenshot below.

React Component Naming Conventions

handleSearchTermChange describes a local function that handles the change. onSearchTermChange describes a callback prop that the child invokes. Keeping this distinction is a small habit that makes component communication much easier to follow.

For more examples of passing interactions through components, see how to handle events in React and passing a function to a child component.

Pro Tip: In my experience, do not rename every callback to onClick. A button inside EmployeeCard may use onClick, but the component’s public prop should usually reveal the business action, such as onEmployeeSelect or onEmployeeDelete.

Name Hooks and State Clearly

Hooks are React functions that let functional components use features such as state, effects, and shared logic. Built-in hooks use names like useState and useEffect. Your custom hooks should always start with use.

For example, a custom hook that loads directory employees should be called useEmployees, not getEmployees or loadData.

import { useEffect, useState } from "react";

export function useEmployees() {
const [employees, setEmployees] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [errorMessage, setErrorMessage] = useState("");

useEffect(() => {
async function loadEmployees() {
try {
const response = await fetch("/api/employees");

if (!response.ok) {
throw new Error("Unable to load employees.");
}

const employeeData = await response.json();
setEmployees(employeeData);
} catch (error) {
setErrorMessage(error.message);
} finally {
setIsLoading(false);
}
}

loadEmployees();
}, []);

return { employees, isLoading, errorMessage };
}

I executed the above example code and added the screenshot below.

React Component Naming Conventions

This hook runs an API request in useEffect. useEffect handles work outside rendering, such as fetching data after the component first appears. The names isLoading and errorMessage make UI states easy to understand.

Use these state naming patterns:

  • employees and setEmployees
  • selectedEmployee and setSelectedEmployee
  • isLoading and setIsLoading
  • errorMessage and setErrorMessage
  • searchTerm and setSearchTerm

Avoid state names such as flag, status, temp, or result unless their meaning is obvious.

import EmployeeList from "./EmployeeList";
import { useEmployees } from "./useEmployees";

export default function EmployeeDirectoryPage() {
const { employees, isLoading, errorMessage } = useEmployees();

if (isLoading) {
return <p>Loading employees...</p>;
}

if (errorMessage) {
return <p role="alert">{errorMessage}</p>;
}

return <EmployeeList employees={employees} />;
}

This page uses clear error handling and loading states. The code is easier to scan because isLoading and errorMessage describe exactly why each branch renders.

If your project is converting to TypeScript, this guide on React component types in TypeScript is a useful next step.

Use Consistent File Names

Most React teams use the component name as the file name:

EmployeeDirectoryPage.jsx
EmployeeSearchInput.jsx
EmployeeList.jsx
EmployeeCard.jsx
useEmployees.js

This convention makes imports predictable:

import EmployeeCard from "./EmployeeCard";
import EmployeeList from "./EmployeeList";
import EmployeeSearchInput from "./EmployeeSearchInput";

Use PascalCase file names for components and camelCase for hooks, utilities, and helpers.

components/
EmployeeCard.jsx
EmployeeList.jsx
EmployeeSearchInput.jsx

hooks/
useEmployees.js

utils/
formatEmployeeName.js
getDepartmentLabel.js

A utility function is not a component, so formatEmployeeName.js should use camelCase. A React component is a UI unit, so EmployeeCard.jsx should use PascalCase.

For larger React applications, organize folders around features rather than one giant components folder:

features/
employees/
EmployeeDirectoryPage.jsx
EmployeeList.jsx
EmployeeCard.jsx
EmployeeSearchInput.jsx
useEmployees.js

This feature-based structure keeps employee-related code together. It also makes future changes safer because you can find the relevant files quickly.

Name Reusable Components Carefully

Reusable components need names that balance general use with clarity. A component used across many features should not be named after one business area.

For example, this component can work in employee, product, and ticket pages:

export default function EmptyState({ title, message, actionLabel, onAction }) {
return (
<section className="empty-state">
<h2>{title}</h2>
<p>{message}</p>

{actionLabel && (
<button type="button" onClick={onAction}>
{actionLabel}
</button>
)}
</section>
);
}

EmptyState is a good generic name because it describes a common UI pattern. Its props stay flexible without becoming vague.

Use it in the employee directory like this:

<EmptyState
title="No employees found"
message="Try a different name or department."
actionLabel="Clear search"
onAction={handleClearSearch}
/>

The component stays reusable, while the parent supplies business-specific content.

Do not force generic names too early. If a component only serves one screen, EmployeeSearchInput is better than SearchInput. You can generalize later when a second real use case appears.

Things to Keep in Mind

  • Start component names with capitals: Use PascalCase for React components so JSX treats them as custom components rather than HTML tags.
  • Name by responsibility: Choose names such as EmployeeList or TicketDetailsPanel that explain one focused UI job.
  • Keep props specific: Prefer employees, selectedEmployee, and onEmployeeSelect over broad names like data, item, and callback.
  • Reserve use for hooks: Every custom hook should start with use, such as useEmployees or useTicketFilters, so React tooling and developers can identify it quickly.
  • Match file and component names: Keep EmployeeCard.jsx aligned with EmployeeCard to make imports, searches, and code reviews faster.
  • Avoid premature generic components: Build a focused component first, then generalize it only after you find a real reuse case.

Frequently Asked Questions

Should React component names always use PascalCase?

Yes. React components should use PascalCase, such as EmployeeCard or SupportTicketTable. A lowercase JSX tag is treated as a browser HTML element rather than a custom React component.

Can I use kebab-case for React component file names?

You can, but it is less common in React projects. Using EmployeeCard.jsx to match the exported EmployeeCard component makes files easier to find and imports easier to read.

How should I name React props?

Name props after the value or action they represent. Use singular names for one object, plural names for arrays, is or has prefixes for Boolean values, and on prefixes for callback props.

What is the difference between onClick and handleClick?

onClick is usually a prop passed into a component. handleClick is usually a local function that responds to the event inside the component. This distinction makes event flow clearer in larger React applications.

Should custom React hooks start with use?

Yes. Use names like useEmployees, useApiRequest, or useLocalStorage. The use prefix tells developers and React tooling that the function follows hook rules and may call other hooks.

How do I name a component that handles too many tasks?

Split it by responsibility. For example, turn EmployeeDashboard into EmployeeSearchInput, EmployeeList, EmployeeCard, and EmployeeDetailsModal when each part has separate UI or logic. You can also use a React container component pattern to separate data logic from display components.

React component naming conventions are simple, but they shape how easily a project grows. Start with clear PascalCase component names, specific props, and meaningful event handlers, then keep each component focused on one job. I hope you found this article helpful.

You May Also Like

Leave a Comment

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.