Patterns 4 patterns
Fundamentals
These patterns are about how you structure frontend code, from how much each component should do to how you organize the files in a project. Most of the other patterns build on them, so they’re worth learning first.
- Barrel Export Index files that re-export a directory's modules from one entry point, so import paths are shorter and the directory has a clear public API.
- Semantic HTML Semantic HTML uses the right element for each part of a page, so browsers and screen readers understand its structure before you add any ARIA attributes.
- Separation of Concerns Splitting code into separate layers for data, logic, presentation, and styling makes an app easier to change.
- Single Responsibility With single responsibility, each component or function has one clear purpose and only one reason to change.