<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Umar Yusuf</title>
    <description>The latest articles on DEV Community by Umar Yusuf (@luwadev).</description>
    <link>https://dev.to/luwadev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1128997%2F14141145-05ab-4f87-95ad-7275c6917842.jpeg</url>
      <title>DEV Community: Umar Yusuf</title>
      <link>https://dev.to/luwadev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luwadev"/>
    <language>en</language>
    <item>
      <title>How to create a dropdown menu with HTML and CSS</title>
      <dc:creator>Umar Yusuf</dc:creator>
      <pubDate>Tue, 31 Oct 2023 15:41:00 +0000</pubDate>
      <link>https://dev.to/luwadev/how-to-create-a-dropdown-menu-with-html-and-css-20b2</link>
      <guid>https://dev.to/luwadev/how-to-create-a-dropdown-menu-with-html-and-css-20b2</guid>
      <description>&lt;p&gt;Dropdown menus are a fundamental component of web development, offering a convenient way to present a list of options to users.&lt;br&gt;
In this tutorial, I'll guide you through the process of creating a simple dropdown menu using HTML and CSS.&lt;/p&gt;

&lt;p&gt;To get the most out of this tutorial, you should have some basic knowledge of HTML and CSS. If you're new to these technologies, you might want to check out some introductory tutorials.&lt;/p&gt;

&lt;p&gt;Having said that, let's dive right in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add HTML Markup
&lt;/h2&gt;

&lt;p&gt;We'll start by creating the HTML structure for our dropdown menu. We'll use an unordered list &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; to represent the menu items and nested lists to create submenus. Here is how our HTML markup will look like:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;nav&amp;gt;
     &amp;lt;ul&amp;gt;
         &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;
                &amp;lt;a href="#"&amp;gt;Resources&amp;lt;/a&amp;gt;
                &amp;lt;ul&amp;gt;
                    &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Blog&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Academy&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Reviews&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;/ul&amp;gt;
            &amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;
                &amp;lt;a href="#"&amp;gt;Newsletters&amp;lt;/a&amp;gt;
                &amp;lt;ul&amp;gt;
                    &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Blog&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Socials&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Reviews&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;/ul&amp;gt;
            &amp;lt;/li&amp;gt;
           &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
           &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
      &amp;lt;/ul&amp;gt;
&amp;lt;/nav&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here is our result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fryqs6jpbclh5nmr9ogcm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fryqs6jpbclh5nmr9ogcm.png" alt="HTML output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's add some CSS to style our dropdown menu in the next section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add CSS Styling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; We'll start by removing the default list styles and resetting the default padding and margin to eliminate any spacing around the list.&lt;/p&gt;

&lt;p&gt;Here's the CSS:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After that, let's style the main menu &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; items within the &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; element. We'll set them to display as &lt;code&gt;inline-block&lt;/code&gt; elements, which places them horizontally next to each other.&lt;/p&gt;

&lt;p&gt;Here's the CSS:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nav ul li {
    display: inline-block;
    position: relative;
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, we'll style the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; elements by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting them to display as block elements. so they occupy the entire width of their parent list items.&lt;/li&gt;
&lt;li&gt;Adding some padding for spacing around the text.&lt;/li&gt;
&lt;li&gt;We'll add some &lt;code&gt;transition&lt;/code&gt; to create a smooth color change effect when you hover over the menu items.&lt;/li&gt;
&lt;li&gt;Changing the &lt;code&gt;background-color&lt;/code&gt; on hover to make it a little bit visually appealing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the CSS:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nav ul li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #f0f0f0;
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; Now, let's add some styles for the dropdown &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;submenus within the main menu &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; items by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hiding them by default using &lt;code&gt;display: none&lt;/code&gt; and give them a &lt;code&gt;position: absolute&lt;/code&gt; so they are placed relative to their parent list items.&lt;/li&gt;
&lt;li&gt;we'll also set a hover effect on the main menu &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;, which displays the associated submenu by changing the display property to block.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the CSS:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nav ul li ul {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc;
}

nav ul li:hover ul {
    display: block;
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Finally, To finish up styling the dropdown menu, we'll add the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Styles the individual items within the dropdown submenu. It ensures they are displayed as block-level elements and prevents wrapping of text using &lt;code&gt;white-space: nowrap&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Similar to the main menu items, we'll make them display as block-level elements, add padding for spacing and include a transition effect for &lt;code&gt;background-color&lt;/code&gt; changes on hover.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the CSS:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nav ul li ul li {
    display: block;
    white-space: nowrap;
}

nav ul li ul li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

nav ul li ul li a:hover {
    background-color: #f0f0f0;
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Final result:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94ba3d9qujc1iy0jcane.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94ba3d9qujc1iy0jcane.gif" alt="final dropdown menu view"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Creating a dropdown menu with HTML and CSS is a fundamental skill for web developers. With the steps outlined in this tutorial, you've built a simple yet functional dropdown menu. You can now expand on this foundation to create more complex menus and integrate them into your web projects.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>How to create a simple mobile responsive navigation bar with HTML, CSS and JavaScript</title>
      <dc:creator>Umar Yusuf</dc:creator>
      <pubDate>Thu, 26 Oct 2023 13:03:01 +0000</pubDate>
      <link>https://dev.to/luwadev/how-to-create-a-simple-mobile-responsive-navigation-bar-with-html-css-and-javascript-341h</link>
      <guid>https://dev.to/luwadev/how-to-create-a-simple-mobile-responsive-navigation-bar-with-html-css-and-javascript-341h</guid>
      <description>&lt;p&gt;Navigation bars are essential components used a lot in websites and web apps. As a software developer, you will need to be able to create and customize them, either for yourself or for a client project.&lt;/p&gt;

&lt;p&gt;In this article, you'll learn how to create a simple mobile responsive navigation bar with HTML, CSS, and JavaScript. This article assumes that you have basic knowledge of HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;p&gt;Let's get right into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 - Add HTML Markup
&lt;/h2&gt;

&lt;p&gt;Before adding the HTML markup for our navigation bar, let's import a hamburger icon from Google icons. we'll be using the hamburger icon to toggle the navigation menu in small screens.&lt;/p&gt;

&lt;p&gt;To import and use the hamburger icon from google, add the snippet below in the head of your HTML file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" /&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, add the markup below to your HTML file. I will explain it later.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;header class="header"&amp;gt;
        &amp;lt;div class="nav-container"&amp;gt;
            &amp;lt;span class="logo"&amp;gt;NavBar&amp;lt;/span&amp;gt;
            &amp;lt;nav class="nav"&amp;gt;
                &amp;lt;ul class="nav--ul__one"&amp;gt;
                    &amp;lt;li class="nav-link"&amp;gt;&amp;lt;a href="#"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li class="nav-link"&amp;gt;&amp;lt;a href="#"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li class="nav-link"&amp;gt;&amp;lt;a href="#"&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;/ul&amp;gt;
                &amp;lt;ul class="nav--ul__two"&amp;gt;
                    &amp;lt;li class="nav-link"&amp;gt;&amp;lt;a href="#"&amp;gt;Login&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                    &amp;lt;li class="nav-link"&amp;gt;&amp;lt;a href="#"&amp;gt;Signup&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;/ul&amp;gt;
            &amp;lt;/nav&amp;gt;
            &amp;lt;span class="hamburger-menu  material-symbols-outlined"&amp;gt;menu&amp;lt;/span&amp;gt;
        &amp;lt;/div&amp;gt;
&amp;lt;/header&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The HTML markup consists of the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; element with the class of &lt;code&gt;header&lt;/code&gt; that wraps the all the elements.&lt;/li&gt;
&lt;li&gt;Inside the &lt;code&gt;header&lt;/code&gt;, you have a container &lt;code&gt;div&lt;/code&gt; with the class &lt;code&gt;nav-container&lt;/code&gt;. This &lt;code&gt;div&lt;/code&gt; wraps the &lt;code&gt;logo&lt;/code&gt;, navigation links, and the hamburger menu.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element with the class &lt;code&gt;logo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; element with the class &lt;code&gt;nav&lt;/code&gt; as the main navigation container. This container holds the navigation links and hamburger menu icon.&lt;/li&gt;
&lt;li&gt;Inside the &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, you have two list of navigation links each represented with a &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; with the class of &lt;code&gt;nav--ul__one&lt;/code&gt; and &lt;code&gt;nav--ul__two&lt;/code&gt; respectively.&lt;/li&gt;
&lt;li&gt;You have another &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element with the class &lt;code&gt;hamburger-menu&lt;/code&gt; and an icon class &lt;code&gt;material-symbols-outlined&lt;/code&gt; which represents the hamburger menu icon.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2bp0pm0l3139ow61dyo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2bp0pm0l3139ow61dyo.png" alt="markup result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that done, now let's add some styles to make our navigation bar visually appealing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 - Style the Navigation Bar
&lt;/h2&gt;

&lt;p&gt;We'll start by resetting the default padding and margin of every element of the page, and add some basic styling to a few elements.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now that we are done with some basic styling, let's focus on styling the core navigation bar itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigation Menu Styles
&lt;/h3&gt;

&lt;p&gt;Here is the markup to style the navigation:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

header {
    background: #4D4DDB;
    color: white;

    padding: .5rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 90%;
    margin: 0 auto;
}


.nav-container .logo {
    font-size: 2rem; 
    font-weight: bold;  
}

.nav {
    display: flex;
    flex-grow: 1;
}

.nav--ul__one {
    margin: 0 auto;
}

.nav-container, .nav--ul__one,
.nav--ul__two {
    display: flex;
    gap: 1.6rem;
    font-size: 1.2rem;
}

.hamburger-menu {
    display: none; /* Hidden by default for larger screens */
    cursor: pointer;
}



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Our navigation bar would look like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flfmyuk4p35hksltxwlf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flfmyuk4p35hksltxwlf3.png" alt="navigation bar styles"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, let's add some media query to make our navigation bar mobile responsive.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@media (max-width: 700px) {
    .nav-container .logo {
        font-size: 1.2rem;
        z-index: 2;
    }

    .nav {
        flex-direction: column;
        gap: 2rem;
    }

    .nav--ul__one,
    .nav--ul__two {
        flex-direction: column;
        gap: .6rem;
    }

    .hamburger-menu {
        display: block;

        z-index: 2;
    }

    .nav {
        position: absolute;
        top: 0;
        right: -100%;
        bottom: 0;
        width: 100%;

        padding-top: 6rem;

        align-items: center;
        text-align: center;
        background-color: #4D4DDB;
        color: white;

        transition: 0.15s ease-in-out;
    }

    .nav.active {
        right: 0;
    }

}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;First, this arranges the elements on small screens, and most importantly, making the &lt;code&gt;nav&lt;/code&gt; slide in from the right when active but of course, it is not functional. we'll do that next. &lt;/p&gt;

&lt;p&gt;Here is the result so far:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjimxmeyww9zqa7rhadbh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjimxmeyww9zqa7rhadbh.gif" alt="navigation bar responsiveness on small screens"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's work on the functionality in the next section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 - Add JavaScript Functionality
&lt;/h2&gt;

&lt;p&gt;Here are the steps we'll use to add javascript functionality to the navigation bar:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get references to the &lt;code&gt;hamburger-menu&lt;/code&gt; and &lt;code&gt;nav&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add a click event listener to the &lt;code&gt;hamburger-menu&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Toggle the &lt;code&gt;active&lt;/code&gt; class on the &lt;code&gt;nav&lt;/code&gt; to show/hide it&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

const hamburgerMenu = document.querySelector(".hamburger-menu");
const nav = document.querySelector(".nav");

hamburgerMenu.addEventListener("click", () =&amp;gt; {
    nav.classList.toggle("active")
});


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;When the &lt;code&gt;hamburger-menu&lt;/code&gt; is clicked, it toggles the visibility of the menu by adding or removing the &lt;code&gt;active&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;Final result:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgla2tgqe59vk505fs6b9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgla2tgqe59vk505fs6b9.gif" alt="Navigation bar mobile view"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And with this, you’ve successfully built a mobile responsive navigation bar using just HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I sincerely hope you found this post interesting or useful. If you did, kindly react to it and share with your friends or follow my account so you won't miss any future postings. Thanks for reading.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>How to test and analyze website performance with lighthouse</title>
      <dc:creator>Umar Yusuf</dc:creator>
      <pubDate>Wed, 27 Sep 2023 22:34:57 +0000</pubDate>
      <link>https://dev.to/luwadev/how-to-test-and-analyze-website-performance-with-lighthouse-6oe</link>
      <guid>https://dev.to/luwadev/how-to-test-and-analyze-website-performance-with-lighthouse-6oe</guid>
      <description>&lt;p&gt;Lighthouse is an open-source automated tool developed by Google, used for testing and improving the quality of web pages in terms of performance, accessibility, search engine optimization(SEO), and more.&lt;/p&gt;

&lt;p&gt;In this post, we'll cover how you can use lighthouse to test and analyze any website for performance.&lt;/p&gt;

&lt;p&gt;Before we start, let's understand the types of workflows lighthouse offers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lighthouse Workflows
&lt;/h2&gt;

&lt;p&gt;lighthouse offers four workflows you can use to run series of test/audits on a web page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Chrome DevTools: You can directly test any web page from your Chrome browser and read your reports in a user-friendly format.&lt;/li&gt;
&lt;li&gt;From the command line: This let's you automate lighthouse runs using shell scripts&lt;/li&gt;
&lt;li&gt;As a Node module: Integrate Lighthouse into your continuous integration systems.&lt;/li&gt;
&lt;li&gt;From a web UI: You can also run Lighthouse directly from a web UI and also link to reports without installing a thing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We'll be using Chrome DevTools to learn how to test a web page for performance with lighthouse. You can check out any of the workflows above &lt;a href="https://developer.chrome.com/docs/lighthouse/overview/#devtools" rel="noopener noreferrer"&gt;here&lt;/a&gt;: &lt;/p&gt;

&lt;p&gt;With that out of the way, let's run lighthouse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run Lighthouse in Chrome DevTools
&lt;/h2&gt;

&lt;p&gt;Use the following steps to run lighthouse test in your devtools:&lt;br&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Download chrome for Desktop&lt;br&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; Go to the URL of the website you want to test&lt;br&gt;
&lt;strong&gt;Step 3:&lt;/strong&gt; Open chrome Devtools and click the &lt;code&gt;Lighthouse&lt;/code&gt; tab &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbjtgdstuf9bprnz46z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbjtgdstuf9bprnz46z1.png" alt="chrome devtools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lighthouse offers three modes you can use to run tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigation mode: The navigation mode is useful if you want to analyze a single page load.&lt;/li&gt;
&lt;li&gt;Timespan mode: Timespan is used to analyze user interactions on a web page&lt;/li&gt;
&lt;li&gt;Snapshot mode: It typically analyzes the page in a particular state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/GoogleChrome/lighthouse/blob/HEAD/docs/user-flows.md" rel="noopener noreferrer"&gt;learn more about each mode&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Select Navigation mode, and since we are testing only for performance, uncheck the other categories except for &lt;code&gt;performance&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;Step 5:&lt;/strong&gt; Click &lt;code&gt;Analyze page load&lt;/code&gt; to run lighthouse.&lt;/p&gt;

&lt;p&gt;After 30 to 60 seconds, Lighthouse gives you a report on the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwlzp0ru8phhl8w27bvq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwlzp0ru8phhl8w27bvq.png" alt="running lighthouse audits"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Analysis
&lt;/h2&gt;

&lt;p&gt;Lighthouse reports your website performance based on five speed metrics, each measuring some aspect of page speed (also called "load speed") &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkudzn516tsh66cmcxkid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkudzn516tsh66cmcxkid.png" alt="lighthouse metrics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First Contentful Paint (FCP): Measures the time at which the first image or text becomes visible to users.&lt;/li&gt;
&lt;li&gt;Largest Contentful Paint (LCP): It calculates the amount of time a page takes to load it's largest element to users.&lt;/li&gt;
&lt;li&gt;Total Blocking Time (TBT): Measures the amount of time a page is blocked from reacting to user input, for example, a mouse click&lt;/li&gt;
&lt;li&gt;Cumulative Layout Shift (CLS): Measures the number of layout shifts that occurs as user assess the page.&lt;/li&gt;
&lt;li&gt;Speed Index (SI): Shows how quickly the content of a page is loaded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After Lighthouse is done testing your website, it assigns an overall performance score to a page based on how it performed for all these metrics. The score can be anything from 0 to 100.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkno64954w060llpoeml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkno64954w060llpoeml.png" alt="overall performance"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A score between 90 and 100 indicates the page is well optimized for user experience.&lt;/li&gt;
&lt;li&gt;Anything less that 90 means there are some/significant number of resources on your page that are slowing things down, therefore affecting the overall page experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lighthouse also gives you suggestions. Which you can implement the performance of your web page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcg324y4et7s50j10583.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcg324y4et7s50j10583.png" alt="Idiagnostics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make you feel a little bit better :-) &lt;br&gt;
Lighthouse also gives you a report of tests your website passed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futvqsiuekmikwnc2h1bu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futvqsiuekmikwnc2h1bu.png" alt="passed audits"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, you have learned how to test your website's performance with lighthouse. You can also test your website for things like accessibility, SEO, and more. &lt;/p&gt;

&lt;p&gt;If this article was helpful to you, please react to it. Doing so will help me in writing better articles.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>learning</category>
      <category>performance</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>How to deploy a React application with Netlify in two simple ways</title>
      <dc:creator>Umar Yusuf</dc:creator>
      <pubDate>Sat, 02 Sep 2023 10:47:50 +0000</pubDate>
      <link>https://dev.to/luwadev/how-to-deploy-a-react-application-with-netlify-in-two-simple-ways-127i</link>
      <guid>https://dev.to/luwadev/how-to-deploy-a-react-application-with-netlify-in-two-simple-ways-127i</guid>
      <description>&lt;p&gt;Netlify is a service which offers a development platform that automates builds, deployments and manages your websites. It’s one of the fastest and easiest deployment solutions out there.&lt;/p&gt;

&lt;p&gt;In this article, you will learn how to deploy your React application with Netlify in two simple ways. &lt;/p&gt;

&lt;p&gt;Before we get started, let's get you signed up to netlify!&lt;/p&gt;

&lt;h2&gt;
  
  
  Signup to Netlify
&lt;/h2&gt;

&lt;p&gt;Use the following steps to sign up to netlify:&lt;br&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Go to &lt;a href="https://app.netlify.com/" rel="noopener noreferrer"&gt;app.netlify.com&lt;/a&gt; and click the signup button.&lt;/p&gt;

&lt;p&gt;You can choose any of the options to signup to netlify, for this example we will use GitHub&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi44jco3z3b1yeuxelfcf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi44jco3z3b1yeuxelfcf.png" alt="netlify sign up page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; You will be taken to the authentication page. Input your Github &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt; to continue to netlify&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1c0k109flfum2vcci5g8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1c0k109flfum2vcci5g8.png" alt="netlify auth"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You would be asked to verify your email (email associated with your GitHub account):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6261r33g6cv9e2noaht9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6261r33g6cv9e2noaht9.png" alt="verify Github account"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, you should see something like this but not exactly, because the image below is an already existing account, hopefully you get the idea:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmnb7e8ey0zrvmk0cp7df.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmnb7e8ey0zrvmk0cp7df.png" alt="netlify user dashboard"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Deploy to Netlify
&lt;/h2&gt;

&lt;p&gt;Netlify offers three methods you can use to deploy your app, but we are going to focus on just two.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Drag and Drop
&lt;/h3&gt;

&lt;p&gt;Use the following steps to deploy your app using &lt;code&gt;drag and drop&lt;/code&gt;&lt;br&gt;
method:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Go to the react app you want to deploy in your code editor and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command above will build your react app for production.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs33etltrz1agyimbbds1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs33etltrz1agyimbbds1.png" alt="Building for production"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that a build folder named &lt;code&gt;dist&lt;/code&gt; will get generated. The folder contains all the production-ready files of your application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fra830zmlbiiafriplam2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fra830zmlbiiafriplam2.png" alt="Dist folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Go to your netlify dashboard, click the &lt;code&gt;Add new site&lt;/code&gt; button and choose &lt;code&gt;Deploy manually&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9uuihou5n2q3dmkbw00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9uuihou5n2q3dmkbw00.png" alt="netlify dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be taken to the &lt;code&gt;drag and drop&lt;/code&gt; page where you will upload the &lt;code&gt;dist&lt;/code&gt; folder generated earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84mlkwb54k661zr5c40j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84mlkwb54k661zr5c40j.png" alt="drag and drop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After uploading your dist folder, wait a few seconds and you should see something like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnudmioxg5f6vt2b9dtn0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnudmioxg5f6vt2b9dtn0.png" alt="dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;code&gt;open production deploy&lt;/code&gt; button to see your deployed app!&lt;/p&gt;

&lt;h4&gt;
  
  
  Redeploying App
&lt;/h4&gt;

&lt;p&gt;To redeploy your app after making any changes to your code, use the following steps:&lt;br&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Rebuild your app again as we have done earlier.&lt;br&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; Go to your site dashboard (your existing deployed site) and click the&lt;code&gt;Deploys&lt;/code&gt; option&lt;br&gt;
&lt;strong&gt;Step 3:&lt;/strong&gt; Scroll down and re-upload your app &lt;code&gt;dist&lt;/code&gt; folder again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxr4mywmjc44pok314u16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxr4mywmjc44pok314u16.png" alt="redeploying app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Changing Site Name
&lt;/h4&gt;

&lt;p&gt;To change your site name, Use the following steps:&lt;br&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Click the &lt;code&gt;Options&lt;/code&gt; button and go to &lt;code&gt;Deploy settings&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; Navigate to &lt;code&gt;Domain management&lt;/code&gt; option and click it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj96mr945at75r0808uld.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj96mr945at75r0808uld.png" alt="Domain management"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Under &lt;code&gt;Production domains&lt;/code&gt;, click the &lt;code&gt;Options&lt;/code&gt; button and edit your site name:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70300o7829m51nwym8k0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70300o7829m51nwym8k0.png" alt="edit site name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Continuous Deployment
&lt;/h3&gt;

&lt;p&gt;According to netlify:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Continuous deployment works by connecting a Git repository to your Netlify site and keeping the two in sync. When you push to Git, we run your build tool of choice on our servers and deploy the result.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Similar to what we have done earlier, go to your dashboard, &lt;code&gt;click add new site&lt;/code&gt; button and select &lt;code&gt;import an existing project&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After doing so, use the following steps to deploy from an existing project:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Choose any of the options provided by netlify. For this example, we will choose &lt;code&gt;Deploy with GitHub&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwxpcke49kgvxpfmpb3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwxpcke49kgvxpfmpb3b.png" alt="continuous deployment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, you will be asked to authorize your netlify to deploy any of your GitHub repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Select the repository you want to deploy&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F532f5ijrbylfb1at1mdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F532f5ijrbylfb1at1mdf.png" alt="Select repository"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Select the branch you want to deploy from and configure your build settings, we will use the default settings for this example.&lt;/p&gt;

&lt;p&gt;After that, scroll down, click the &lt;code&gt;Deploy&lt;/code&gt; button to deploy your app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F631ez19ji6dr9z3lfi3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F631ez19ji6dr9z3lfi3x.png" alt="deploying app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, you have learned two ways you can deploy your react application with netlify through practical steps. This process can also be used to deploy any other frontend JavaScript libraries like Angular, Vue and more.&lt;/p&gt;

&lt;p&gt;If you've gotten to this part and you found this article to be helpful, kindly react and comment on it, doing so will help me in writing better articles.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>tutorial</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Handling Browser Storage: cookies, local storage, session storage</title>
      <dc:creator>Umar Yusuf</dc:creator>
      <pubDate>Tue, 22 Aug 2023 16:57:17 +0000</pubDate>
      <link>https://dev.to/luwadev/handling-browser-storage-cookies-local-storage-session-storage-33h9</link>
      <guid>https://dev.to/luwadev/handling-browser-storage-cookies-local-storage-session-storage-33h9</guid>
      <description>&lt;p&gt;Modern web browsers offer some number of ways that enable browsers to store data on the user's computer system, and then retrieve it when it is needed, therefore, letting you persist data for long-term storage, retain the user's specific settings for your site, and more. In this article, we will explore three of the most used browser storage options, their use cases, security risks, and how to mitigate them.&lt;/p&gt;

&lt;p&gt;In this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cookies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Local Storage&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Session Storage&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cookies
&lt;/h2&gt;

&lt;p&gt;Cookies (also called HTTP cookies) is a piece of data that a server sends to a user's web browser. The user's web browser stores the cookie and then sends it back to the same server with later requests.&lt;/p&gt;

&lt;p&gt;To get a better understanding of how cookies work. let's use this example, imagine you are at a restaurant. The waiter gives you a special card (cookie) with your name on it. You keep the card and show it to the waiter whenever you go back to the restaurant. The waiter knows who you are and what you like. Cookies work the same way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;p&gt;Cookies are mainly used for the following purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Session management:&lt;/strong&gt; Cookies are usually used to manage user sessions. They store temporary information, therefore, helping users stay logged in as they navigate through different pages of the website. Some other examples are shopping carts, game scores, or anything else the server should remember.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Personalization:&lt;/strong&gt; Cookies are also used to store user preferences and settings, enabling websites to tailor the experience to individual users. This could include things like theme settings, language preference and other settings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tracking:&lt;/strong&gt; Cookies are often used by websites and advertisers to record and analyze user behavior.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cookie Security
&lt;/h3&gt;

&lt;p&gt;Cookie security is the act of protecting the information stored in cookies, which websites use as small text files to retain user preferences and sessions.&lt;/p&gt;

&lt;p&gt;While cookies enhance user experiences, they can also expose security risks such as session hijacking, &lt;a href="https://portswigger.net/web-security/cross-site-scripting" rel="noopener noreferrer"&gt;cross-site scripting(XSS)&lt;/a&gt;, and &lt;a href="https://www.synopsys.com/glossary/what-is-csrf.html" rel="noopener noreferrer"&gt;cross-site request forgery(CSRF)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here are some ways to mitigate the security risks associated with cookies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate and sanitize user inputs to prevent XSS attacks that might target cookies&lt;/li&gt;
&lt;li&gt;Make sure to implement proper authentication and authorization mechanisms to prevent session hijacking&lt;/li&gt;
&lt;li&gt;Use secure HTTPS connections to transmit cookies&lt;/li&gt;
&lt;li&gt;Regularly audit and validate cookies to prevent unauthorized usage&lt;/li&gt;
&lt;li&gt;Implement secure cookie attributes like &lt;code&gt;HttpOnly&lt;/code&gt; and &lt;code&gt;Secure&lt;/code&gt; to limit cookie exposure&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn more: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies" rel="noopener noreferrer"&gt;using HTTP Cookies&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Local Storage
&lt;/h2&gt;

&lt;p&gt;Local storage is a client-side web browser storage that enables websites and apps to store persistent data with no expiration date. This means that local storage holds the data even if the user refreshes the web page or closes the browser.&lt;/p&gt;

&lt;p&gt;More properties of local storage include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local storage offers a high storage limit of around &lt;code&gt;5MB&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It is only accessible through client-side JavaScript and cannot be accessed by the server&lt;/li&gt;
&lt;li&gt;The syntax is straightforward&lt;/li&gt;
&lt;li&gt;Local storage data is not automatically sent to the server with every HTTP request, unless the data is specifically requested&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;p&gt;Local storage can be used in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeping track of user's shopping cart until they make a purchase&lt;/li&gt;
&lt;li&gt;Storing frequently used data in order to reduce the need for repeated server requests therefore improving website performance and reducing costs &lt;/li&gt;
&lt;li&gt;Storing user's preferences and settings, theme choices to personalize user experience&lt;/li&gt;
&lt;li&gt;Keeping track/saving of partially completed forms or drafts so users can resume their work later&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Accessing local storage
&lt;/h3&gt;

&lt;p&gt;Local storage is an object that is accessed through the browser's window interface. The local storage object has a &lt;code&gt;setItem()&lt;/code&gt; function that accepts two arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;key:&lt;/strong&gt; The key acts as a unique identifier to the stored data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value:&lt;/strong&gt; The stored data itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To store data in local storage, open the console tab in your browser's dev tools, and run the following command to assign the string value of &lt;code&gt;"How are you today?"&lt;/code&gt; to the key-labeled &lt;code&gt;question&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

localStorage.setItem("question", "How are you today?");


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To see what you have stored in local storage, you can use the developer tools in your web browser. For example, in Firefox, click the &lt;code&gt;storage&lt;/code&gt; tab to view the contents of local storage.&lt;/p&gt;

&lt;p&gt;You should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjotrr7gi3rybd42mpahz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjotrr7gi3rybd42mpahz.png" alt="firefox dev tools"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The local storage object also offers two other functions &lt;code&gt;removeItem()&lt;/code&gt; and &lt;code&gt;clear()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;removeItem()&lt;/code&gt; deletes the data stored for a specific item. For example, the following command deletes the data we stored above using it's &lt;code&gt;key&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

localStorage.removeItem("question");


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And the below command deletes all local storage data in the browser's memory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

localStorage.clear()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Local Storage Security
&lt;/h3&gt;

&lt;p&gt;Local storage in web browsers poses some security risks if not managed properly. Some of these risks include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If your application is vulnerable to XSS attacks, malicious scripts injected into your web pages can access and manipulate data in local storage, since JavaScript running on a page has access to it. This can lead to data theft or tampering.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storing sensitive data such as user authentication tokens and personal data in local storage without proper encryption can expose the data to potential attacks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unless removed explicitly, data in local storage persist indefinitely thereby increasing the risk of data exposure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Although local storage follows the same-origin policy, there are techniques such as CSRF attacks that can be used to trick a user into performing actions that lead to data being stored in local storage. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some ways to mitigate local storage security risks in your application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encrypt sensitive data such as user authentication and personal settings/data before storing it to local storage.&lt;/li&gt;
&lt;li&gt;Validate user inputs to prevent XSS attacks.&lt;/li&gt;
&lt;li&gt;Frequently clear outdated or unnecessary data from local storage.&lt;/li&gt;
&lt;li&gt;Implement proper access controls and authorization checks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Session Storage
&lt;/h2&gt;

&lt;p&gt;Session storage is another form of client-side web browser storage. session storage shares similar properties with local storage but with &lt;strong&gt;one key difference&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The data stored in session storage is only available for as long as the user's browser session is active. When the user closes the tab or browser, the data is cleared automatically.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Session storage is suitable for storing data that is only needed during a single user session, such as shopping cart or temporary user preferences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Session storage can help in maintaining the state of a web application across different views or components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Session storage can also be used to store form data temporarily as users navigate between pages to prevent data loss, if they accidentally close the browser or tab.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Accessing Session Storage
&lt;/h3&gt;

&lt;p&gt;Similar to what we have done in local storage, you can use the &lt;code&gt;setItem()&lt;/code&gt; function to assign the string value of &lt;code&gt;"How are you today?"&lt;/code&gt; to the key labeled &lt;code&gt;question&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sessionStorage.setItem("question", "How are you today?")


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;As we've seen earlier, you can go to the &lt;code&gt;storage&lt;/code&gt; tab of Firefox to view the contents of session storage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgen8y88lml2eh93jw0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgen8y88lml2eh93jw0d.png" alt="session storage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similarly, like local storage, the data stored in session storage can also be deleted by clearing out the browser’s memory or with the &lt;code&gt;removeItem()&lt;/code&gt; and &lt;code&gt;clear()&lt;/code&gt; functions:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;sessionStorage.removeItem("question")&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;sessionStorage.clear()&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Session Storage Security&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;Like other client-side storage, session storage has certain security considerations that you should be aware of, to ensure user data protection and to mitigate potential security risks. Here are some potential risks associated with session storage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Similar to other web storage mechanisms, session storage can be vulnerable to XSS attacks&lt;/li&gt;
&lt;li&gt;Potential attackers can hijack user's session and gain access to the data stored. This makes it crucial to implement robust session management and authentication mechanisms&lt;/li&gt;
&lt;li&gt;Sensitive data stored in session storage such as user authentication tokens can be exposed, if an attacker gains access to the user's device or compromises the browser session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To mitigate these security risks when using session storage, consider the following best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encrypt sensitive data before storing it to add an additional layer of security&lt;/li&gt;
&lt;li&gt;Always validate user inputs to prevent XSS attacks&lt;/li&gt;
&lt;li&gt;Clear data from session storage as soon as it's no longer needed to reduce or prevent the risk of data exposure&lt;/li&gt;
&lt;li&gt;Implement strong session management to ensure your application is secure and includes mechanisms to prevent session hijacking&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Browser storages such as local storage and session storage help developers store and manage data on the client side, facilitating faster access to information, reducing server load, and improving user experiences in web applications.&lt;/p&gt;

&lt;p&gt;In this article we explored the three most used browser storage options, their use cases, security risks, and ways to mitigate them.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Getting started with React: how to create a basic React application</title>
      <dc:creator>Umar Yusuf</dc:creator>
      <pubDate>Sat, 12 Aug 2023 10:19:26 +0000</pubDate>
      <link>https://dev.to/luwadev/getting-started-with-react-how-to-create-a-basic-react-application-4an7</link>
      <guid>https://dev.to/luwadev/getting-started-with-react-how-to-create-a-basic-react-application-4an7</guid>
      <description>&lt;p&gt;React is a JavaScript front-end library created by Meta (formerly known as Facebook). React is a free and open-source front-end library used for creating interactive websites and mobile  user interfaces (UI for short). In this article, you will learn how to set-up and create a basic react application. This article will not go in-depth about react features.&lt;/p&gt;

&lt;p&gt;To get the  most out of this article, you should have some basic knowledge of Node Package Manager(NPM). Take some time to familiarize yourself with it: &lt;a href="https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/" rel="noopener noreferrer"&gt;Beginner's Guide to using NPM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we get started, let's discuss some benefits of React&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of using React
&lt;/h2&gt;

&lt;p&gt;React offers tons of benefits, which makes it stand out from other Front-end frameworks like Angular, Vue, Svelte etc.&lt;/p&gt;

&lt;p&gt;Some of the benefits React offers include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;React code is simple and easy to maintain due to its modular structure, therefore saving huge amount of time and money to businesses compared to other front-end frameworks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Components in React are declarative, making it easy to build interactive UIs. you only need to describe how you want your UI to be and React will take care of the rendering.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With React, you can build reusable components which can be used in multiple parts/sections of your application, therefore making it easy to maintain and develop your application over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When it comes to relevant resources and support, React has a large and active developer community which you can rely on.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now with that out of the way, let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing React Application
&lt;/h2&gt;

&lt;p&gt;We will be using visual studio code to install and create our React application but you can use any of your preferred code editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;  Launch your code editor, toggle the terminal and then run the command below to install React:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the above command, you will be prompted to perform the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a project name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose a framework&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select a variant&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; We will name our project &lt;code&gt;new-project&lt;/code&gt;, but you can name it whatever you wish.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4i239p58e8l7rdayotl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4i239p58e8l7rdayotl5.png" alt="create a project name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Choose React&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2vb5csnio7551kp76y4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2vb5csnio7551kp76y4.png" alt="select a framework"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Select JavaScript&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feut62mpn9q9ikj0k1lnw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feut62mpn9q9ikj0k1lnw.png" alt="select a variant"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, run the following commands to start the installation process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd new-project
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installation process will take some few minutes. so just exercise some patience till it is completed.&lt;/p&gt;

&lt;p&gt;The folder structure should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focj6z8hwgz4iwilv0c2l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focj6z8hwgz4iwilv0c2l.png" alt="React Application folder struture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Use the command below to run your React application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the process is done, you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffg5qs5olug908kvg4b2t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffg5qs5olug908kvg4b2t.png" alt="Application launched successfully"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hover over &lt;code&gt;http://127.0.0.1:5173/&lt;/code&gt; and click it to open and view the React application in your browser or you can just copy and paste it to your browser.&lt;/p&gt;

&lt;p&gt;You should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fld88jr80zpj014si94ji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fld88jr80zpj014si94ji.png" alt="React Application"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating React Application
&lt;/h2&gt;

&lt;p&gt;For this example, we'll be creating the classic &lt;strong&gt;"Hello World"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Use the following steps to create your React application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;App.jsx&lt;/code&gt;, &lt;code&gt;index.css&lt;/code&gt; and &lt;code&gt;App.css&lt;/code&gt; files in your React Application folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delete all the default template code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write the code below in your &lt;code&gt;App.jsx&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const App = () =&amp;gt; {
  return (
    &amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;
  )
}

export default App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your &lt;code&gt;App.jsx&lt;/code&gt; file should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flyvmzrbjm5s9futrw81v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flyvmzrbjm5s9futrw81v.png" alt="App.jsx file code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save the changes you made in you &lt;code&gt;App.jsx&lt;/code&gt; file and check your React application in the browser.&lt;/p&gt;

&lt;p&gt;You should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2rrp8bz69vf5gknyjqbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2rrp8bz69vf5gknyjqbp.png" alt="React Application"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Congratulations,&lt;/strong&gt; you have created your first &lt;strong&gt;React Application&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, you have gotten an overview of React, learned its benefits and how to create a basic React application.&lt;/p&gt;

&lt;p&gt;If you are interested in learning the in-depth features of React, you can check out this free online React course by &lt;em&gt;Bob Zirol&lt;/em&gt; here: &lt;a href="https://scrimba.com/learn/learnreact" rel="noopener noreferrer"&gt;Learn React&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>frontend</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
