A Short Guide to Component Naming

by Mohammad Tommalieh, Senior Frontend Engineer

1. Clarity and Purpose

When naming components, focus on creating descriptive names that clearly communicate the component's purpose and functionality. Choose names that will make sense to other developers and your future self.

For example, instead of "btn", use "SubmitButton" or "NavigationButton". Rather than "md", use "ConfirmationModal" or "SettingsModal". Clear naming reduces cognitive load and makes the codebase more maintainable.

2. Consistent Naming Patterns

In large codebases, establishing and following consistent naming patterns is essential. This helps team members quickly understand and locate components.

Use descriptive but concise names that follow your team's conventions. For example, "SignInButton" clearly indicates both the purpose (sign in) and the type of component (button). Avoid overly long names that include unnecessary implementation details.

3. Standardize Language

When working on international teams, it's important to establish a standard language for component naming. English is typically used as the common programming language to ensure consistency and clear communication across the team.

Maintain documentation that explains component naming conventions and consider adding comments in multiple languages if needed. This approach maintains code clarity while still supporting global collaboration.

More articles

The Future of Web Development: Key Trends for 2023

Explore the transformative trends in web development that are shaping the industry and revolutionizing how we build for the web.

Read more

3 Lessons We Learned Going Back to the Office

After two years of remote work, we made the transition back to the office. Here are the key insights we gained from this significant change in our work environment.

Read more

Tell us about what you have in mind

Our office

  • International House
    142 Cromwell Road
    London, England, SW7 4EF