Speed Up Your Coding Using Emmet - A Really Powerful Tool

Full Stack Developer | Freelancer | JavaScript | React | Nodejs.
Loves sharing knowledge through technical articles.
Dev.to: https://dev.to/myogeshchavan97
https://linktr.ee/myogeshchavan97
Search for a command to run...

Full Stack Developer | Freelancer | JavaScript | React | Nodejs.
Loves sharing knowledge through technical articles.
Dev.to: https://dev.to/myogeshchavan97
https://linktr.ee/myogeshchavan97
It's been a week am wondering how to enable emmet for react, since I know its work for my vsCode on html & css, then today found your post on section "Enable emmet for React", its tremendously save my day. Thank you for sharing !!!
oh.. It's great to hear that this article was helpful to you to enable emmet for React. Thank you 🙏
This is one great article. Emmet just made it a whole lot easier and faster.
Thank you so much David Jonathan. Glad you found it useful 🙂
Emmet is one of the best things to happen to web development in my opinion. This is an amazing explanation of how to use Emmet effectively. Thanks for writing this article, Yogesh Chavan.
That's very true. Edidiong Asikpo. Emmet really makes coding a lot faster and it's the most useful thing for web development.
Thanks for your views on it🙏
This is a really good walkthrough on how to use Emmet. Any tool that makes our jobs easier and faster is a godsend.
Thank you so much Andrew Baisden. Emmet is the best tool even HTML developers love to use.
In this tutorial, you will build a Task Management App using Next.js 16 and Prisma 7 from scratch. By creating this app, you will learn: How to set up Prisma 7 with the new Rust-free architecture How to configure a database with Prisma's driver ada...

If you're a React/Next.js developer who diligently updated your packages last week after the critical React2Shell vulnerability (CVE-2025-55182), I have some frustrating news: you need to update again. Security researchers, while probing the patches ...

Is your React app dragging its feet, but you can’t pinpoint the cause? You might think you’re following the best practices, but some common development patterns are actually degrading your app’s performance behind the scenes. In this article, we’ll u...

How to Use Separate SSH Keys for Company and Personal GitHub Accounts Managing multiple GitHub accounts is a common challenge for developers who juggle both personal and professional projects. It becomes even more complex when you want to use differe...

Have you ever built a React app only to realize that users from different countries can't use it effectively because it only supports English? In this tutorial, you'll learn how to build truly global React application using internationalization (i18n...


In this article, we will explore all about Emmet. A very popular and highly useful tool that is built into almost every IDE out there like Visual Studio Code, Sublime Text etc.
If you're using Codepen, then you might be happy to know that Emmet is also available in CodePen. So you can type abbreviations to generate code in Codepen.
It allows us to just type some abbreviations and generate the output HTML and CSS code.
It increases your productivity to a great extent so you don't have to type the same repetitive code again and again.
Emmet is already available in almost every IDE so you don't need to install it.
If for some reason, it's not available in your IDE, you can install the extension from this page.
We just have to type the abbreviation and press the Tab key and Emmet will convert it to the corresponding code.
.html file, then instead of manually typing the doctype, head, meta, body, just type ! (exclamation mark) and press tab and Emmet will add the default HTML code
hero-banner then instead of manually typing <div class="hero-banner">Some content</div>, just type .hero-banner and press tab key and the entire code will be generated for you.
As you can see, once the code is generated, Emmet automatically places the cursor inside the div so you don't need to click inside the div to type content inside the div.
div when you don't specify the tag name.But you can specify your own tag name also.
Suppose you want to create a section with two classes namely box and showcase then you just need to type section.box.showcase and press the tab key.

numbersAbbreviation: #numbers

Abbreviation: div>p*3

As you can see, once the code is generated, Emmet automatically placed the cursor inside the paragraph so you just need to press the tab key to move to the next paragraph to type the content inside it
Abbreviation: div>p*3>lorem

btn and class primary-btnAbbreviation: div#btn.primary-btn

Abbreviation: ul>li*3>a

menu-items and 3 li's with class menu-item and with an anchor tag inside itAbbreviation: ul.menu-items>li*3.menu-item>a

Abbreviation: div*4>h2+ul>li*2

Here, we wanted h2 and ul to be side by side so we have used the + operator
Abbreviation: ul>li.item$*4

Here, $ represents an incrementing number starting with 1.
If for some reason, you want to generate a number starting with 0, use the abbreviation ul>li.item$@0*4

Here, we have specified the number after $ with @ symbol
click here inside itAbbreviation: button{click here}

Click here to continue text where here is a linkAbbreviation: p>{Click }+a{here}+{ to continue}

Abbreviation: input:c or input:checkbox

You actually don't need to remember some abbreviations like input, just type input: and VS Code will suggest you with various Emmet abbreviations

Abbreviation: script:src

Abbreviation: a[href='#']

To specify multiple attributes separate them with spaces inside the brackets

Note: If for some reasons, the Emmet suggestion hides and pressing tab does not complete the code, just delete the last character of the abbreviation or press ctrl + space to get the Emmet suggestions and then press tab key.
Emmet also works in CSS files.
Abbreviation: bg

Abbreviation: pos:a

There are tons of abbreviations for CSS but you don't need to remember any of them. VS Code makes it really easy by providing suggestions while typing
So to add background-color just type backc(back for background and c for color)


So for CSS, you don't need to remember the Emmet abbreviations. VS Code will help you out by providing suggestions.
Control + Shift + P or Command + Shift + P (Mac) to open command palette and type setting and then select Preferences: Open User Settings option
Search for emmet in the search box as shown in the below screenshot
On the left side, expand the extension menu and click on emmet
Then click on the Add Item button under Emmet: Include Languages section
And then enter javascript under the Item textbox and enter javascriptreact under the Value textbox.

Now open any component file from React application and type .albums and press the tab key and it will be converted to <div className="albums"></div>

As you can see, Emmet automatically converts class to className, If we're in a .js file.
div.container>h1.title+h2.subtitle+div>div*4>h3+ul>li*4>a
To find out more about such amazing abbreviations check out the Emmet Cheatsheet.
That's it about this article. In this article, we have seen that,
Want to learn all ES6+ features in detail including let and const, promises, various promise methods, array and object destructuring, arrow functions, async/await, import and export and a whole lot more from scratch?
Check out my Mastering Modern JavaScript book. This book covers all the pre-requisites for learning React and helps you to become better at JavaScript and React.
Check out free preview contents of the book here.
Also, you can check out my free Introduction to React Router course to learn React Router from scratch.
Want to stay up to date with regular content regarding JavaScript, React, Node.js? Follow me on LinkedIn.