Organizing component architecture and structure in React

As React applications grow, keeping your component architecture clear and maintainable is essential. A well-structured codebase makes collaboration easier, reduces duplication, and improves developer experience β€” especially in teams or when building scalable design systems.

This post shares how I organize components and visual structure in React, based on current best practices, including recent patterns influenced by modern frameworks like Next.js, React Server Components (RSC), and design systems.


πŸ’‘ Group by feature or domain

Rather than splitting everything into global folders like components/, hooks/, or utils/, I prefer grouping by feature or domain. This approach scales well and mirrors how users experience the app.

src/
β”œβ”€β”€ dashboard/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ index.js
β”‚   └── DashboardPage.jsx
β”œβ”€β”€ settings/
β”‚   └── ...
β”œβ”€β”€ shared/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ utils/
β”‚   └── theme/

πŸ“¦ Presentational vs container components

Although hooks have blurred the line between UI and logic, separating presentational components (focused on visuals) from containers (focused on logic/state) is still helpful β€” especially for reusability and testing.

/components/
β”œβ”€β”€ Button/
β”‚   β”œβ”€β”€ Button.jsx
β”‚   β”œβ”€β”€ Button.test.js
β”‚   β”œβ”€β”€ button.module.css
β”‚   └── index.js         # for clean imports
└── UserProfile/
    β”œβ”€β”€ UserProfile.jsx   # Presentational
    β”œβ”€β”€ useUserProfile.js # Data logic
    └── index.js

This setup supports co-location of styles, tests, and logic within the component’s folder.


🎨 Visual hierarchy and design consistency

Organize UI layers from the page level down to atoms:

Pages β†’ Layouts β†’ Sections β†’ Components β†’ Elements

Best practices:


βš™οΈ Modern Patterns in 2025

As of 2025, these trends continue to shape how teams structure React projects: