Saved

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.

  1. 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. Beginner
  2. 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. Beginner
  3. Separation of Concerns Splitting code into separate layers for data, logic, presentation, and styling makes an app easier to change. Beginner
  4. Single Responsibility With single responsibility, each component or function has one clear purpose and only one reason to change. Beginner