A Short Guide to Component Naming

by Vuk Dukic, Senior Software Engineer

1. Brevity is Key

Time is scarce, don’t waste it typing out long, descriptive component names. One approach is to give them short, cryptic names that only you will understand.

Need a button? Call it "btn". A modal? How about "md"? You’ll save precious minutes per day and you’ll get the added benefit of being the only person in the codebase who knows where anything is. This is called job security.

2. Rank High in Search

When working in large repos with lots of collaborators, it’s important that your component ranks high when people search for anything.

One way to stand out is to include all the possible search terms in your component name. Instead of “SignInButton” you might want call it “SignInButtonAuthenticationCookieUserLogIn” which will ensure that it is returned in almost any related search result.

3. Mix Languages

If you work remotely, it’s likely you are on a global team and yet all your components have English names. This slows down your non-english colleagues considerably so you should allow them to use their native tongue when naming components.

You can create an index file that maps all the different languages within your repo. Need a dropdown? Look for “Desplegable”. A form? Search “Форма”. You’ll learn multiple new languages while being more inclusive to your colleagues.

Schedule a demo

More articles

How Blogging Can Double Your New Patient Calls

Dental practices with active blogs generate 67% more leads than those without, directly translating to increased patient calls. Research shows that 70% of patients prefer learning about healthcare providers through educational content rather than traditional advertising, while blog posts addressing common dental concerns rank for 3-4 times more keywords than standard service pages

Read more

Dental Clinic Reviews: Strategies to Get 5 Stars Without Being Pushy

Getting authentic 5-star reviews shouldn't feel like pulling teeth, yet many dental practices struggle with the delicate balance between encouraging patient feedback and appearing desperate or pushy. In today's digital landscape, where 88% of consumers trust online reviews as much as personal recommendations, your practice's online reputation directly impacts your bottom line

Read more