<?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: Sara</title>
    <description>The latest articles on DEV Community by Sara (@mitevskasar).</description>
    <link>https://dev.to/mitevskasar</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%2F395430%2F4a76b40d-4901-4ca5-b305-6bab20d47e40.jpg</url>
      <title>DEV Community: Sara</title>
      <link>https://dev.to/mitevskasar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mitevskasar"/>
    <language>en</language>
    <item>
      <title>Creating Accessible Forms in React</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Mon, 17 Jun 2024 08:05:00 +0000</pubDate>
      <link>https://dev.to/mitevskasar/creating-accessible-forms-in-react-363e</link>
      <guid>https://dev.to/mitevskasar/creating-accessible-forms-in-react-363e</guid>
      <description>&lt;h2&gt;
  
  
  Why is accessibility in web forms important
&lt;/h2&gt;

&lt;p&gt;Accessibility in web forms ensures that all users, including those using assistive technologies such as screen readers and keyboard-only navigation, can interact with and complete web forms easily. There are already established accessibility standards and best practices that developers can follow to create inclusive online web forms that improve the overall user experience by making it usable for everyone. (Some resources are included at the end of this post).&lt;/p&gt;

&lt;h2&gt;
  
  
  Semantic HTML form elements
&lt;/h2&gt;

&lt;p&gt;One of the most important step to creating accessible forms is using the proper semantic HTML form elements such as: &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;datalist&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;output&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;option&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;optgroup&amp;gt;&lt;/code&gt;. All of these elements clearly describe their meaning in a human and machine-readable way and provide context to web content, enabling assistive technologies to interpret and interact with the content accurately.&lt;/p&gt;

&lt;p&gt;Properly structured semantic HTML elements also enable better keyboard navigation essential for users who rely on keyboards or other input devices other than mouse. Using the correct element such as &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; will ensure that pressing the &lt;em&gt;Tab&lt;/em&gt; key through a form follows a logical order, that will make form completion easier, or using a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element will trigger form submission by default when the &lt;em&gt;Enter&lt;/em&gt; key is pressed. In the same way, associating a &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; with an &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; helps screen readers announce the label when the input field is focused, which helps users understand the purpose of the field.&lt;/p&gt;

&lt;p&gt;In some situations, custom form elements might be needed if the provided HTML elements are not enough for the purpose of if a more customised look is required. In which case it is very important to make the custom elements accessible using the proper &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA" rel="noopener noreferrer"&gt;ARIA (Accessible Rich Internet Applications)&lt;/a&gt; roles and attributes. However, relying on semantic HTML elements whenever possible will certainly reduce the need for additional ARIA roles and properties which will minimise complexity and potential errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to create accessible forms
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Placeholders
&lt;/h3&gt;

&lt;p&gt;Most often, placeholder text is used to provide instructions or an example of what kind of data is required for a certain form field. It is usually displayed with lower colour contrast and it disappears when the user starts typing. Placeholders can provide valuable guidance for many users, however it is important to always use it alongside a label as assistive technologies do not treat placeholders as labels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Labels
&lt;/h3&gt;

&lt;p&gt;Label elements provide clear, descriptive text associated with form fields that allow all users to better understand the purpose of each field. Here are a few approaches of using label elements when creating accessible forms.&lt;/p&gt;

&lt;h4&gt;
  
  
  Explicitly associating labels with form fields:
&lt;/h4&gt;

&lt;p&gt;The most common and recommended approach is using the &lt;em&gt;&lt;strong&gt;for&lt;/strong&gt;&lt;/em&gt; attribute on a &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; element to associate it with an &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; element by matching the &lt;em&gt;&lt;strong&gt;for&lt;/strong&gt;&lt;/em&gt; attribute with the &lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt; of the input element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;label for="username"&amp;gt;Username&amp;lt;/label&amp;gt;
   &amp;lt;input type="text" id="username" name="username"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Wrapping the form field in label element:
&lt;/h4&gt;

&lt;p&gt;Sometimes the &lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt; of a form field might not be known or even present. In cases like this, the &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; is used as a container for both the label text and the form field so that the two are associated implicitly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;label&amp;gt;
      Username
      &amp;lt;input type="text" name="username"/&amp;gt;
   &amp;lt;/label&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, explicitly associating labels is generally better supported by assistive technology.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using additional instructions aside from labels
&lt;/h4&gt;

&lt;p&gt;In some cases, additional instructions aside from the label might be required. Such as: a helper text below the input field or an additional description bellow a label element. To make the form accessible in scenarios like this, you can use the &lt;em&gt;&lt;strong&gt;aria-labelledby&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;aria-describedby&lt;/strong&gt;&lt;/em&gt; attributes. Here is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;label id="dateLabel" for="dateOfBirth"&amp;gt; Date of birth:&amp;lt;/label&amp;gt;
   &amp;lt;input type="text" name="dateOfBirth" id="dateOfBirth" aria-labelledby="dateLabel dateHelperText"&amp;gt;
   &amp;lt;span id="dateHelperText"&amp;gt;MM/YYYY&amp;lt;/span&amp;gt;                                                                    


   &amp;lt;label id="dateLabel" for="dateOfBirth"&amp;gt;Date of birth:&amp;lt;/label&amp;gt;
   &amp;lt;input type="text" name="dateOfBirth" id="dateOfBirth" aria-labelledby="dateLabel" aria-describedby="dateHelperText"&amp;gt;
   &amp;lt;span id="dateHelperText"&amp;gt;MM/YYYY&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Hiding the label
&lt;/h4&gt;

&lt;p&gt;Sometimes, the design requires omitting a label from the form field, but it is still necessary for a fully accessible form. Fortunately, there is a solution you can apply in situations like this.&lt;/p&gt;

&lt;h5&gt;
  
  
  Hiding the label visually
&lt;/h5&gt;

&lt;p&gt;The most common approach used is to hide the label visually but keep it available to the assistive technology devices. It can be achieved by using css to hide the element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;label for="example" class="visually-hidden"&amp;gt;
      Example Label
   &amp;lt;/label&amp;gt;
   &amp;lt;input type="text" id="example" name="example"/&amp;gt;  

   .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      border: 0;
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Please note that using visibility: hidden will not work properly in this case. The label must be hidden by displaying it in a 1 pixel area like in the example in order for the screen readers to interpret it.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Labelling buttons
&lt;/h4&gt;

&lt;p&gt;When it comes to labelling buttons, there are also a few possible solutions to make it accessible. Let's take a look at some.&lt;/p&gt;

&lt;h5&gt;
  
  
  Adding the label inside the element
&lt;/h5&gt;

&lt;p&gt;The standard and most common approach is adding a visible text inside the button element.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h5&gt;
  
  
  Using &lt;em&gt;aria-label&lt;/em&gt; Attribute
&lt;/h5&gt;

&lt;p&gt;This attribute provides an accessible name to button elements that don't have visible text, usually buttons that contain an icon.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;button aria-label="Submit"&amp;gt;✔️&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Using &lt;em&gt;title&lt;/em&gt; Attribute
&lt;/h5&gt;

&lt;p&gt;Alternatively, the text can be placed in the &lt;em&gt;&lt;strong&gt;title&lt;/strong&gt;&lt;/em&gt; attribute. This attribute can provide additional information, although it is less preferred than &lt;em&gt;&lt;strong&gt;aria-label&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Visually hidden label
&lt;/h5&gt;

&lt;p&gt;A more accessible alternative for buttons that don't have visible text is an approach similar to the visually hidden label: text that is visually hidden using CSS next to the icon.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;button&amp;gt;
      &amp;lt;span class="visually-hidden"&amp;gt;Submit&amp;lt;/span&amp;gt; ✔️
   &amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Using the &lt;em&gt;value&lt;/em&gt; attribute
&lt;/h5&gt;

&lt;p&gt;When using an &lt;code&gt;&amp;lt;input type="button"&amp;gt;&lt;/code&gt; for a button element, the label can be placed in the &lt;em&gt;&lt;strong&gt;value&lt;/strong&gt;&lt;/em&gt; attribute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;input type="button" value="Submit" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Using image as button
&lt;/h5&gt;

&lt;p&gt;If the image button &lt;code&gt;&amp;lt;input type="image"&amp;gt;&lt;/code&gt; is used, the label is set in the alt attribute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;input type="image" src="button.png" alt="Submit"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Grouping elements
&lt;/h3&gt;

&lt;p&gt;Grouping form elements using the appropriate HTML elements such as &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt; provides semantic meaning to assistive technologies. Screen readers can understand the relationship between form elements within the group, making it easier for the users to understand the form as well.&lt;/p&gt;

&lt;p&gt;Grouping form elements also allows users to navigate between related fields more easily using the keyboard. Users can typically jump between form fields within the group using the &lt;em&gt;Tab&lt;/em&gt; key, improving the overall usability and accessibility of the form.&lt;/p&gt;

&lt;p&gt;When a group of form elements is focused, assistive technologies can announce the group's label or legend, providing users with context about the purpose of the group. This helps users better understand the structure of the form.&lt;/p&gt;

&lt;h4&gt;
  
  
  Grouping related fields using Fieldset and Legend
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; element semantically groups related form fields which allows assistive technologies to interpret and understand their relationship. Visually grouped elements also make the form easier to understand and use by any user.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; element is used in combination with the &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt; element, which provides a caption for the group. Here is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;form&amp;gt;
      &amp;lt;fieldset&amp;gt;
         &amp;lt;legend&amp;gt;Personal Information&amp;lt;/legend&amp;gt;
         &amp;lt;label for="firstName"&amp;gt;First Name:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="firstName" name="firstName"&amp;gt;
         &amp;lt;label for="lastName"&amp;gt;Last Name:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="lastName" name="lastName"&amp;gt;
       &amp;lt;/fieldset&amp;gt;
       &amp;lt;fieldset&amp;gt;
         &amp;lt;legend&amp;gt;Address&amp;lt;/legend&amp;gt;
         &amp;lt;label for="street"&amp;gt;Street:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="street" name="street"&amp;gt;
         &amp;lt;label for="city"&amp;gt;City:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="city" name="city"&amp;gt;
       &amp;lt;/fieldset&amp;gt;
       &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
   &amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Radio Buttons, Checkboxes or related fields must also be grouped using &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; with corresponding &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For select elements with groups of options, the &lt;code&gt;&amp;lt;optgroup&amp;gt;&lt;/code&gt; element can be used to indicate such groups. The label attribute of the &lt;code&gt;&amp;lt;optgroup&amp;gt;&lt;/code&gt; element is used to provide a label for the group.&lt;/p&gt;

&lt;h4&gt;
  
  
  Grouping related fields with WAI-ARIA
&lt;/h4&gt;

&lt;p&gt;When using &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt; is not an option (perhaps the design requires more custom element), the same grouping of elements can be achieved by associating the related fields using &lt;a href="https://www.w3.org/WAI/standards-guidelines/aria/" rel="noopener noreferrer"&gt;WAI-ARIA&lt;/a&gt; attributes. Such attributes are: &lt;em&gt;&lt;strong&gt;aria-labelledby&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;aria-describedby&lt;/strong&gt;&lt;/em&gt;. For example, &lt;em&gt;&lt;strong&gt;aria-labelledby&lt;/strong&gt;&lt;/em&gt; can link a group of related fields to a heading that describes their collective purpose ensuring that screen readers correctly interpret this relationship to the users.&lt;/p&gt;

&lt;p&gt;Additionally, applying the attribute &lt;em&gt;&lt;strong&gt;role="group"&lt;/strong&gt;&lt;/em&gt; on an element such as &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; can be used to define a logical grouping of related fields, providing a semantic structure that assistive technologies can read.&lt;/p&gt;

&lt;p&gt;Let's modify the code of the previous example by using WAI-ARIA attributes to associate related fields without using &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;legend&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;form&amp;gt;
      &amp;lt;div role="group" aria-labelledby="personalInfoHeading"&amp;gt;
         &amp;lt;h2 id="personalInfoHeading"&amp;gt;Personal Information&amp;lt;/h2&amp;gt;
         &amp;lt;label for="firstName"&amp;gt;First Name:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="firstName" name="firstName"&amp;gt;
         &amp;lt;label for="lastName"&amp;gt;Last Name:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="lastName" name="lastName"&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div role="group" aria-labelledby="addressHeading"&amp;gt;
         &amp;lt;h2 id="addressHeading"&amp;gt;Address&amp;lt;/h2&amp;gt;
         &amp;lt;label for="street"&amp;gt;Street:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="street" name="street"&amp;gt;
         &amp;lt;label for="city"&amp;gt;City:&amp;lt;/label&amp;gt;
         &amp;lt;input type="text" id="city" name="city"&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
   &amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Keyboard Navigation
&lt;/h3&gt;

&lt;p&gt;As mentioned in this guide, enabling proper keyboard navigation is a very important step when creating accessible forms to provide a good user experience to users that use keyboard for navigating though the web. If you rely mostly on using semantic HTML elements, this is not something you need to worry about. However, when a certain custom element needs to be incorporated in a web form, you might need to follow some of the establish standards on how it should function so that you can provide proper keyboard navigation and full accessibility in your form.&lt;/p&gt;

&lt;p&gt;Depending on the type and purpose of element, the standars can slightly differ. For example, creating a custom &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; (comobox) element might require different keyboard navigation than a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element would. Since this is a bit larger topic, in this guide we'll only mention a few of the most common requirements for a custom form field.&lt;/p&gt;

&lt;p&gt;For example, each element contained in a form should be focused and interacted with using the &lt;em&gt;Tab&lt;/em&gt; key. This is usually achieved by using the &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex" rel="noopener noreferrer"&gt;&lt;strong&gt;tabindex&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt; attribute. Some elements such as &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; should have a &lt;em&gt;keyDown&lt;/em&gt; event listener on &lt;em&gt;Enter&lt;/em&gt; key that will allow the specific option to be selected, the specific button clicked or the form to be submitted. In the same way, pressing the &lt;em&gt;Escape&lt;/em&gt; key should dismiss open popups/menus and similar elements.&lt;/p&gt;

&lt;p&gt;All standards, rules and patterns for specific elements can be found on the &lt;a href="https://www.w3.org/WAI/ARIA/apg/patterns/" rel="noopener noreferrer"&gt;WAI-ARIA documentation.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Form validation and Errors
&lt;/h3&gt;

&lt;p&gt;Effective form validation includes providing clear information about required and optional fields along with concise error messages that are accessible to screen readers and other assistive technologies.&lt;/p&gt;

&lt;h4&gt;
  
  
  Required fields
&lt;/h4&gt;

&lt;p&gt;Required fields in forms are usually marked by using either the &lt;em&gt;&lt;strong&gt;required&lt;/strong&gt;&lt;/em&gt; attribute, the * symbol next to the label or both. While this may provide a good visual experience for some users, to make sure that all users can easily interact with the form additional attributes such as &lt;em&gt;&lt;strong&gt;aria-required&lt;/strong&gt;&lt;/em&gt; should be used, especially when using custom elements other than the semantic HTML form elements.&lt;/p&gt;

&lt;p&gt;Most current web browsers automatically set the value of &lt;em&gt;&lt;strong&gt;aria-required&lt;/strong&gt;&lt;/em&gt; to true when the HTML5 required attribute is present.&lt;/p&gt;

&lt;p&gt;Please note that the &lt;em&gt;&lt;strong&gt;aria-required&lt;/strong&gt;&lt;/em&gt; attribute, like all ARIA states and properties, only helps the screen readers and such devices to interpret an element as required but they have no impact on element functionality. Functionality and behaviour must be added in with JavaScript.&lt;/p&gt;

&lt;h4&gt;
  
  
  Displaying errors
&lt;/h4&gt;

&lt;p&gt;Displaying errors in forms can be as simple as showing a certain text containing a message explaining the error for incorrect input. When using the semantic HTML elements like input with the specific &lt;em&gt;&lt;strong&gt;type&lt;/strong&gt;&lt;/em&gt; attribute such as: 'date', 'number', 'tel', 'email' etc. such message is shown by default that is already adapted for accessibility. But when a more customised error message is needed, specific attributes must also be applied to ensure accessibility.&lt;/p&gt;

&lt;p&gt;The attributes &lt;em&gt;&lt;strong&gt;aria-invalid&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;aria-errormessage&lt;/strong&gt;&lt;/em&gt; should be used together to indicate an error in a form field. Both &lt;em&gt;&lt;strong&gt;aria-invalid&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;aria-errormessage&lt;/strong&gt;&lt;/em&gt; are applied to the input field while the &lt;em&gt;&lt;strong&gt;aria-invalid&lt;/strong&gt;&lt;/em&gt; is a boolean value indicating if there is an error or not, and &lt;em&gt;&lt;strong&gt;aria-errormessage&lt;/strong&gt;&lt;/em&gt; contains the &lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt; of the element where the error message is shown. The &lt;em&gt;&lt;strong&gt;aria-errormessage&lt;/strong&gt;&lt;/em&gt; attribute should only be used when the value of a field is not valid that is when &lt;em&gt;&lt;strong&gt;aria-invalid&lt;/strong&gt;&lt;/em&gt; is set to 'true'. If the field is valid and you include the &lt;em&gt;&lt;strong&gt;aria-errormessage&lt;/strong&gt;&lt;/em&gt; attribute, make sure the element referenced is hidden, as the message it contains is not relevant. Here is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;label for="email"&amp;gt;*Email address:&amp;lt;/label&amp;gt;
      &amp;lt;input
         id="email"
         type="email"
         name="email"
         aria-invalid="true"
         aria-errormessage="emailError"
      /&amp;gt;
   &amp;lt;span id="emailError"&amp;gt;Incorrect email&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, the screen reader won't automatically read the error message when it appears solely based on the presence of &lt;em&gt;&lt;strong&gt;aria-errormessage&lt;/strong&gt;&lt;/em&gt; attribute. To allow announcing the error message when there is an error on change on the input or on form submit, you should apply another attribute on the element that contains the error message: &lt;em&gt;&lt;strong&gt;aria-live&lt;/strong&gt;&lt;/em&gt;. This attribute can have one of the three values:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;assertive&lt;/strong&gt; - Indicates that updates to the region have the highest priority and should be presented to the user immediately.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;off (default)&lt;/strong&gt; - Indicates that updates to the region should not be presented to the user unless the user is currently focused on that region.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;polite&lt;/strong&gt; - Indicates that updates to the region should be presented at the next graceful opportunity, such as at the end of speaking the current sentence or when the user pauses typing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FormFusion and accessibility
&lt;/h2&gt;

&lt;p&gt;If you are like me and you are not a fan of repeating code or you simply don't want to worry too much about accessibility you can always use libraries such as &lt;a href="https://formfusion.dev?src=devto" rel="nofollow noopener noreferrer"&gt;FormFusion&lt;/a&gt; that make creating forms easy and worry-free. The library offers fully accessible form elements easy to customise along with built-in validation.&lt;/p&gt;

&lt;p&gt;Here is an example of the form mentioned previously, built using FormFusion:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   import { Form, Input } from 'formfusion';
   import './App.css';

   function App() {
      return (
         &amp;lt;Form&amp;gt;
            &amp;lt;fieldset&amp;gt;
              &amp;lt;legend&amp;gt;Personal Information&amp;lt;/legend&amp;gt;
              &amp;lt;Input
                type="alphabetic"
                id="firstName"
                name="firstName"
                label="First name"
                classes={{ root: 'formControl', error: 'formControl__error' }}
              /&amp;gt;
              &amp;lt;Input
                type="alphabetic"
                id="lastName"
                name="lastName"
                label="Last name"
                classes={{ root: 'formControl', error: 'formControl__error' }}
              /&amp;gt;
              &amp;lt;Input
                type="email"
                id="email"
                name="email"
                label="Email"
                required
                classes={{ root: 'formControl', error: 'formControl__error' }}
              /&amp;gt;
            &amp;lt;/fieldset&amp;gt;
            &amp;lt;fieldset&amp;gt;
              &amp;lt;legend&amp;gt;Address&amp;lt;/legend&amp;gt;
              &amp;lt;Input
                type="text"
                id="street"
                name="street"
                label="Street"
                classes={{ root: 'formControl', error: 'formControl__error' }}
              /&amp;gt;
              &amp;lt;Input
                type="alphabetic"
                id="city"
                name="city"
                label="city"
                classes={{ root: 'formControl', error: 'formControl__error' }}
              /&amp;gt;
            &amp;lt;/fieldset&amp;gt;
            &amp;lt;button type="submit"&amp;gt;Save&amp;lt;/button&amp;gt;
          &amp;lt;/Form&amp;gt;
        );
      }

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

&lt;/div&gt;



&lt;p&gt;FormFusion will automatically add all of the necessary attributes to make the form fully accessible. It will also handle the validation and how the errors are displayed depending on the selected validation method (&lt;em&gt;&lt;strong&gt;validateOnChange&lt;/strong&gt;&lt;/em&gt; or &lt;em&gt;&lt;strong&gt;validateOnBlur&lt;/strong&gt;&lt;/em&gt;). The final HTML structure of this code in the browser, assuming that the email field was already interacted with, will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;form class="FormFusion"&amp;gt;
      &amp;lt;fieldset&amp;gt;
         &amp;lt;legend&amp;gt;Personal Information&amp;lt;/legend&amp;gt;
          &amp;lt;div class="FormFusion-Input__root formControl"&amp;gt;
            &amp;lt;label for="firstName" class="FormFusion-Input__root__label"&amp;gt;First name&amp;lt;/label&amp;gt;
            &amp;lt;input 
              id="firstName" 
              name="firstName" 
              class="FormFusion-Input__root__field" 
              type="text" 
              pattern="^[a-zA-Z\s]+" 
              data-type="alphabetic" 
              value="" 
              aria-invalid="false" 
            /&amp;gt;
            &amp;lt;span
              class="FormFusion-Input__root__error formControl__error"
              id="FormFusion-firstName-error"
              aria-live="polite"&amp;gt;
            &amp;lt;/span&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class="FormFusion-Input__root formControl"&amp;gt;
            &amp;lt;label for="lastName" class="FormFusion-Input__root__label"&amp;gt;Last name&amp;lt;/label&amp;gt;
            &amp;lt;input 
              id="lastName" 
              name="lastName" 
              class="FormFusion-Input__root__field" 
              type="text" 
              pattern="^[a-zA-Z\s]+" 
              data-type="alphabetic" 
              value="" 
              aria-invalid="false" 
            /&amp;gt;
            &amp;lt;span
              class="FormFusion-Input__root__error formControl__error"
              id="FormFusion-lastName-error"
              aria-live="polite"&amp;gt;
            &amp;lt;/span&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class="FormFusion-Input__root formControl"&amp;gt;
            &amp;lt;label for="email" class="FormFusion-Input__root__label"&amp;gt;Email&amp;lt;/label&amp;gt;
            &amp;lt;input 
              id="email" 
              name="email" 
              required="" 
              class="FormFusion-Input__root__field" 
              type="email" 
              data-type="email" 
              value="" 
              aria-invalid="true" 
              aria-errormessage="FormFusion-email-error" 
            /&amp;gt;
            &amp;lt;span
              class="FormFusion-Input__root__error formControl__error"
              id="FormFusion-email-error"
              aria-live="polite"&amp;gt;
              Please include an '@' in the email address. 'sa' is missing an '@'.
            &amp;lt;/span&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/fieldset&amp;gt;
        &amp;lt;fieldset&amp;gt;
          &amp;lt;legend&amp;gt;Address&amp;lt;/legend&amp;gt;
          &amp;lt;div class="FormFusion-Input__root formControl"&amp;gt;
            &amp;lt;label for="street" class="FormFusion-Input__root__label"&amp;gt;Street&amp;lt;/label&amp;gt;
            &amp;lt;input 
              id="street" 
              name="street" 
              class="FormFusion-Input__root__field" 
              type="text" 
              value="" 
              aria-invalid="false" 
            /&amp;gt;
            &amp;lt;span
             class="FormFusion-Input__root__error formControl__error"
             id="FormFusion-street-error"
             aria-live="polite"&amp;gt;
           &amp;lt;/span&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class="FormFusion-Input__root formControl"&amp;gt;
            &amp;lt;label for="city" class="FormFusion-Input__root__label"&amp;gt;City&amp;lt;/label&amp;gt;
            &amp;lt;input 
              id="city" 
              name="city" 
              class="FormFusion-Input__root__field" 
              type="text" 
              pattern="^[a-zA-Z\s]+" 
              data-type="alphabetic" 
              value="" 
            /&amp;gt;
            &amp;lt;span
              class="FormFusion-Input__root__error formControl__error"
              id="FormFusion-city-error"
              aria-live="polite"&amp;gt;
            &amp;lt;/span&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/fieldset&amp;gt;
        &amp;lt;button type="submit"&amp;gt;Save&amp;lt;/button&amp;gt;
      &amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full code for this example can be found on &lt;a href="https://github.com/corelabui/accessible-form-react" rel="noopener noreferrer"&gt;Github&lt;/a&gt; and &lt;a href="https://stackblitz.com/~/github.com/corelabui/accessible-form-react" rel="noopener noreferrer"&gt;Stackblitz&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Accessibility in web forms is crucial for creating inclusive web applications. By using semantic HTML elements, following best practices, and applying ARIA roles and attributes, developers can ensure all users, including those that use assistive technologies, can easily complete forms. Well-structured forms with clear labels, logical tab order, and accessible error messages improve usability for everyone. Tools like &lt;strong&gt;FormFusion&lt;/strong&gt; simplify this process by providing accessible form components. Prioritising accessibility from the start ensures a better user experience for all and contributes to a more inclusive digital world.&lt;/p&gt;

&lt;h4&gt;
  
  
  Resources
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/Accessibility&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.w3.org/WAI/ARIA/apg/patterns/" rel="noopener noreferrer"&gt;https://www.w3.org/WAI/ARIA/apg/patterns/&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.w3.org/WAI/standards-guidelines/aria/" rel="noopener noreferrer"&gt;https://www.w3.org/WAI/standards-guidelines/aria/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>reactjsdevelopment</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Exploring React’s Latest extensions to forms</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Thu, 14 Mar 2024 08:08:11 +0000</pubDate>
      <link>https://dev.to/mitevskasar/exploring-reacts-latest-extensions-to-forms-ned</link>
      <guid>https://dev.to/mitevskasar/exploring-reacts-latest-extensions-to-forms-ned</guid>
      <description>&lt;p&gt;React 19 brings exciting enhancements to form handling. It allows developers greater control over user interactions and smoother form management. Let’s outline the key three features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;form&lt;/strong&gt; now accepts a function passed as action prop. If a URL is passed, the form still behaves like the HTML form component but when a function is passed, it will handle the form submission. The function can be async and it’s called with a single argument containing the form data of the submitted form.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;useFormStatus&lt;/strong&gt; hook: Provides status information of the last form submission. Developers can leverage this hook to dynamically respond to user input and provide real-time feedback.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;useFormState&lt;/strong&gt; hook: Allows updating component state based on the result of a form action. Developers can use it to pass an existing form action function as well as an initial state and it returns new action along with the latest form state to be used.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Integrating FormFusion with React’s Latest Updates:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://formfusion.dev?src=devto" rel="nofollow noopener noreferrer"&gt;FormFusion&lt;/a&gt; (form management library) integrates with all of the React’s latest form features. React’s approach to handling a function as an action prop is the default method used in the FormFusion library via the onSubmit prop, however it also supports React’s approach out-of-the-box. Developers can use either and still get the same benefits.&lt;/p&gt;

&lt;p&gt;While React’s form extension allows for client-side submissions, validation remains vital. FormFusion extends the form’s built-in validation by providing validation rules and intuitive error handling mechanisms. Developers can easily apply one of the 500+ validation rules FormFusion offers and bind them to form elements, ensuring data integrity and delivering user-friendly error messages.&lt;/p&gt;

&lt;p&gt;React 19’s form enhancements, combined with FormFusion’s advanced form management capabilities, open up new opportunities for developers. By leveraging FormFusion’s validation, submission on the client-side, and useFormStatus for real-time feedback, developers can build highly performant and user-friendly forms with ease.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://formfusion.dev/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fformfusion.dev%2Fassets%2Fmeta-image.png" height="auto" class="m-0"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://formfusion.dev/" rel="noopener noreferrer" class="c-link"&gt;
          FormFusion: The right way to build forms in React
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Efficient solution for easy form management with built-in validation, input masking, full accessibility and completely customisable look.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fformfusion.dev%2Ffavicon%2Ffavicon-32x32.png"&gt;
        formfusion.dev
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>development</category>
    </item>
    <item>
      <title>Automating React Component Generation with a Shell Script</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Thu, 29 Feb 2024 11:26:11 +0000</pubDate>
      <link>https://dev.to/mitevskasar/automating-react-component-generation-with-a-shell-script-1903</link>
      <guid>https://dev.to/mitevskasar/automating-react-component-generation-with-a-shell-script-1903</guid>
      <description>&lt;p&gt;React components are the building blocks of a React application. Creating them manually can be time-consuming, especially when they follow a similar structure. In this blog post, we'll explore how to automate the process of generating React components using a shell script. We'll build a script that takes a predefined template and creates components with custom names and file structure.&lt;br&gt;
*This example is only for Linux or MacOS&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin, ensure that you have the following set up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A working shell environment (e.g., Bash).&lt;/li&gt;
&lt;li&gt;Node.js and npm installed on your machine.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create a folder named template and create three files: index.js, component.css and interfaces.d.ts (if you're using typescript). If you are using scss or any other styling, create the style file according to your needs. &lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Setting up the Template
&lt;/h2&gt;

&lt;p&gt;First, let's set up a template file that represents the structure and content of a React component. For this simple example, we'll create a simple component that uses css for styling.&lt;br&gt;
&lt;/p&gt;

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

const COMPONENT_NAME = () =&amp;gt; { 
    return (
       &amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;COMPONENT_NAME&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt; 
    );
}; 

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

&lt;/div&gt;



&lt;p&gt;For the styling, create an empty component.css file.&lt;/p&gt;

&lt;p&gt;In the template, we use COMPONENT_NAME as a placeholder that will be replaced with the actual component name during the generation process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Creating the Shell Script
&lt;/h2&gt;

&lt;p&gt;Now, let's create the shell script that will generate React components based on the template. &lt;/p&gt;

&lt;p&gt;Open a text editor and create a new file named generate-component.sh. Place the file in the root folder of your project or anywhere you want. For the example, we'll add the script in the root directory of an existing React project.&lt;/p&gt;

&lt;p&gt;Copy and paste the following code into the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash 

# Prompt the user to enter the path to the component template
read -p "Enter the template path: " template

# Prompt the user to enter the path where the component will be created
read -p "Enter the destination where you want to create the new component: " dest

# Prompt the user to enter the name of the component
read -p "Enter the name of the component: " component_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first step is to use prompt to get the necessary information about the component. The first line reads our input for the path where the template component is located. The second line, reads our input for the path where we want to create the new component, and the third line reads out input for the name of the new component. This can be case insensitive since later in the script we'll capitalize the component name.&lt;/p&gt;

&lt;p&gt;Next we'll check whether the template folder or destination folder given by us exist. If the destination folder i.e the new component location folder doesn't exist, it is created. Add the following code in the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Check if the template folder exists
if [! -d "$template"]; then
echo "Template folder '$template' does not exist."
exit 1
fi

# Check if the destination folder exists, if not, create it
if [! -d "$dest/$component_name"]; then
mkdir -p "$dest/$component_name"
fi 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, what we want to do is copy all contents from the template folder to the newly created component folder. Add the following commands to the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash 

# Copy all contents from the template folder to the destination folder
cp -R "$template"/* "$dest/$component_name"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the new folder created with the same files as the template.&lt;/p&gt;

&lt;p&gt;Next, we'll improve the script a bit and make all the renaming to customize the new component.&lt;/p&gt;

&lt;p&gt;First, we'll capitalize the component name and replace the placeholder with our new component name, and then we'll rename the component.css file to our component_name.css. If you're using scss or other, you'll need to adapt the script to use that file extention.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash 

# Capitalize the first letter of the component name
first_letter = $(echo "${component_name:0:1}" | tr '[:lower:]' '[:upper:]')
capitalized_name = "${first_letter}${component_name:1}"

# rename all occurencies of COMPONENT_NAME with the capitalized component
find "$dest/$component_name" - type f - exec sed - i '' - e "s/COMPONENT_NAME/$capitalized_name/g" { } +

# rename the css file from component.css to $component_name.css
mv "$dest/$component_name/component.css" "$dest/$component_name/$component_name.css"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, we'll print a success message that will tell us that the component is created successfully.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash 

echo "Component '$capitalized_name' created successfully!" 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Running the Script
&lt;/h2&gt;

&lt;p&gt;To run the script, open a terminal, navigate to the directory where the script file is located, and execute 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;sh ./generate-component.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that you might need to change the permissions to run the script. To make the file executable you can run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x generate-component.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you run the script, it will prompt you to enter the template path, the location where you want the component to be created and the component name. If you want to make the generation quicker without option to enter the path names, you can adapt the script to use pre-defined locations for the template and the components folder. &lt;/p&gt;

&lt;p&gt;After entering the information, the script will generate a new component file based on the template, replacing the placeholder with the provided component name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Generating components using npm in a React project
&lt;/h2&gt;

&lt;p&gt;This step covers incorporating the script in an existing React project and running it using npm.&lt;/p&gt;

&lt;p&gt;First, place the script we created in the previous steps in the React project where you want to automate component generation. You can add it either to the root directory, in a new scripts folder etc.&lt;/p&gt;

&lt;p&gt;Next, open the package.json file and scroll down to the "scripts" property.&lt;/p&gt;

&lt;p&gt;Add the following code in the scripts part:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"generate-component": "sh ./generate-component.sh"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also name the script however you like. Save the file and you should be able to run it by running&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 generate-component
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;In this blog post, we've explored how to create a shell script to automate the generation of React components using a predefined template. With this script, you can save time and effort by quickly generating components with a consistent structure.&lt;/p&gt;

&lt;p&gt;Feel free to enhance the script further based on your specific requirements, such as generating additional files (e.g., stylesheets) or adding more complex logic.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Client side validation using FormFusion</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Tue, 27 Feb 2024 08:40:00 +0000</pubDate>
      <link>https://dev.to/mitevskasar/client-side-validation-using-react-form-manager-2igp</link>
      <guid>https://dev.to/mitevskasar/client-side-validation-using-react-form-manager-2igp</guid>
      <description>&lt;p&gt;Client-side validation is a fundamental aspect of web development, vital for delivering user-friendly interfaces and reinforcing the security of online platforms. It involves performing validation checks on the user’s device when filling out forms before sending the data to the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is it important?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It provides instant feedback, making the user’s experience smoother and less error-prone.&lt;/li&gt;
&lt;li&gt;Reduces server load by minimising unnecessary server requests for invalid data.&lt;/li&gt;
&lt;li&gt;Enhances security by limiting what the user can input, thereby preventing malicious attacks like SQL injection or cross-site scripting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  There are two different types of client-side validation that can be found on the web:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Built-in form validation: It uses HTML form validation features, requiring minimal Javascript. This results in better performance than JavaScript validation, although it is less customisable.&lt;/li&gt;
&lt;li&gt;JavaScript validation: Coded using JavaScript, it offers complete customisation. However, it requires creating everything and may be less performant than built-in validation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is where &lt;a href="https://formfusion.dev/" rel="noopener noreferrer"&gt;FormFusion&lt;/a&gt; comes into play. It leverages everything built-in form validation offers plus extends the list of available validation attributes that can be used. It offers 500+ validation types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://formfusion.dev/" rel="noopener noreferrer"&gt;FormFusion&lt;/a&gt; is a minimal yet efficient library that does not rely on any external dependencies. It is neatly packaged into familiar React components and hooks and doesn't require much learning. It is a completely free library available to use for anyone.&lt;/p&gt;

&lt;p&gt;You can read more about what FormFusion offers here: &lt;a href="https://formfusion.dev" rel="noopener noreferrer"&gt;https://formfusion.dev&lt;/a&gt;.&lt;br&gt;
Or checkout some of the examples on Github &lt;a href="https://lnkd.in/gnyqHTu5" rel="noopener noreferrer"&gt;https://lnkd.in/gnyqHTu5&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It’s important to note that client-side validation should not be viewed as a replacement for server-side validation. Server-side validation is also crucial and should always be used along with client-side validation since the network request can still be altered.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Sharing React Components Across Projects using Git Submodules</title>
      <dc:creator>Sara</dc:creator>
      <pubDate>Mon, 26 Feb 2024 10:03:49 +0000</pubDate>
      <link>https://dev.to/mitevskasar/sharing-react-components-across-projects-using-git-submodules-4953</link>
      <guid>https://dev.to/mitevskasar/sharing-react-components-across-projects-using-git-submodules-4953</guid>
      <description>&lt;p&gt;Reusing components and code is a fundamental aspect of React projects, offering developers the ability to write code once and leverage it across different parts of an application. But as projects evolve and grow, the need of reusing components and functionality across various React projects becomes increasingly apparent.&lt;/p&gt;

&lt;p&gt;There are a few ways and platforms that offer code sharing across projects (which I will mention later), however, in this post, we explore a simple concept of code-sharing between different React projects in a more private way by using Git submodules without relying on third-party platforms or tools.&lt;/p&gt;

&lt;p&gt;Git submodules are a feature in Git that allows you to integrate external repositories as dependencies within your project, maintaining their independence and version control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 1: Setting up Git Submodules for Component Sharing
&lt;/h2&gt;

&lt;p&gt;First, we'll need three different remote Git repositories. One will contain the code that we need to reuse - in this case a simple Button component, and the other two projects will be simple React apps with the Button from the shared repository.&lt;/p&gt;

&lt;p&gt;Create three empty remote repositories using the version control tool of your choice (for example Github) named: first-app, second-app and component-library.&lt;/p&gt;

&lt;p&gt;Then, clone the first-app and second-app locally and in each of its root directory run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git submodule add &amp;lt;repository_url&amp;gt; &amp;lt;submodule_path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;where repository_url is the url of the repository you created that will contain the shared Button component, in this case component-library and submodule_path is the name of the directory that will contain the component-library repository, for this example, let's name it components.&lt;/p&gt;
&lt;h2&gt;
  
  
  Section 2: Creating the shared component
&lt;/h2&gt;

&lt;p&gt;Next clone the component-library repository and in the root directory of the component library add a new folder button with index.js file for the component code and button.css for the styling:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// index.js

import './button.css';

function Button() {
  return (
    &amp;lt;button className="button"&amp;gt;
      This is a Button component from my
      Component library
    &amp;lt;/button&amp;gt;
  );
}

export default Button;
&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;// button.css

.button {
  background-color: #E8AA42;
  padding: 10px;
  border: 0;
  border-radius: 5px;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then, commit and push the changes to the remote:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m "create button component"
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Section 3: Using the Shared Components in the other React Project
&lt;/h2&gt;

&lt;p&gt;Now that we built the shared component, let's use it in the two projects. &lt;/p&gt;

&lt;p&gt;First we need to create the apps. Since it is a simple idea, we'll be using create-react-app to create two of the different projects that will share code.&lt;/p&gt;

&lt;p&gt;Clone the first-app locally and in its root directory run:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Since we already setup the submodule, we need to update it to get the latest changes we did.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git submodule update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To use the shared component, open the App.js file and import the Button component from the src/components/button folder. &lt;/p&gt;

&lt;p&gt;Start the application with npm run start and test the changes! You should be able to see the button component.&lt;/p&gt;

&lt;p&gt;Repeat the same process with the second-app repository.&lt;/p&gt;
&lt;h2&gt;
  
  
  Section 4: Managing Changes and Updates
&lt;/h2&gt;

&lt;p&gt;Changes and updates can be done from any repository that uses the submodule or the submodule itself. But note that after some changes are made, you'll need to pull the changes in the repository where you'll need them before making other changes.&lt;/p&gt;

&lt;p&gt;This is maybe one of the biggest disadvantages of using git submodules instead of code-sharing platforms, however the purpose of this post is to explain how to share code with minimum configuration while keeping your code in your private repositories without using third-party platforms. If this doesn't fit your situation you can use other tools and platforms such as Bit.de, Storybook alongside Chromatic, Styleguidist and others.&lt;/p&gt;
&lt;h2&gt;
  
  
  Section 5: Testing shared components in isolation (Optional)
&lt;/h2&gt;

&lt;p&gt;If you also want to view and test the shared components in isolation, then you can do that by adding a little more configuration.&lt;/p&gt;

&lt;p&gt;For this, we'll need to use a build tool that will create the environment where we'll test the shared components. There are a few options here, but this example will use Parcel as it's light and quick and easy to setup. You can also use any other build tool of your choice, whichever best fits your scenario.&lt;/p&gt;

&lt;p&gt;First, open the component-library project and in the root directory, create the following package.json file:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "component-library",
  "source": "index.html",
  "scripts": {
    "start": "parcel",
    "build": "parcel build"
  },
  "devDependencies": {
    "parcel": "latest"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;󠄻󠄩󠄿&lt;br&gt;
Then run the following to install parcel:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev parcel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Next, since we're working with React projects we need to install react and react-dom:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react react-dom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create the entry index.html file and paste the following code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;title&amp;gt;My Component Library&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;div id="app"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;script type="module" src="index.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create an index.js file and paste the following code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createRoot } from "react-dom/client";
import { App } from "./App";

const container = document.getElementById("app");
const root = createRoot(container)
root.render(&amp;lt;App /&amp;gt;);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And finally create the App.js file with the Button component that we want to test:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Button from './button';

export function App() {
  return &amp;lt;Button /&amp;gt;;
}

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

&lt;/div&gt;


&lt;p&gt;To run the application run:&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 start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;and to build run:&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;These commands will build the application and write the output in dist directory.&lt;/p&gt;

&lt;p&gt;You can then open the local server on &lt;a href="http://localhost:1234" rel="noopener noreferrer"&gt;http://localhost:1234&lt;/a&gt; and you should see the Button component.&lt;/p&gt;

&lt;p&gt;While this post does not cover the details of deploying projects, once you have successfully set up the code-sharing mechanism, you can proceed with deploying and publishing the component library on your preferred server. By doing so, you gain the ability to preview and test the shared components at any time.&lt;/p&gt;
&lt;h2&gt;
  
  
  Section 6: Alternatives
&lt;/h2&gt;

&lt;p&gt;Some other alternatives that provide similars value are:&lt;/p&gt;

&lt;p&gt;Bit.dev - a platform that facilitates component-driven development and component sharing across projects. It provides a centralized hub for developers to discover, share, and collaborate on reusable components. With Bit.dev, you can publish and version components, manage their dependencies, and integrate them into different projects, regardless of the framework or tooling being used. It offers features like component documentation, testing, and a package manager-like experience for sharing and consuming components.&lt;/p&gt;

&lt;p&gt;Storybook - a popular open-source tool for developing UI components in isolation. It allows you to build and organize a library of components, view them in different states, and document their usage. Storybook supports various frameworks like React, Vue, Angular, and more.&lt;/p&gt;

&lt;p&gt;Styleguidist - a documentation tool specifically designed for React component libraries. It helps you create living style guides and documentation by providing an interactive environment where you can showcase and test your components.&lt;/p&gt;

&lt;p&gt;Chromatic - a tool that focuses on visual testing and UI review for component-driven development. It integrates with popular component frameworks like React, Angular, and Vue, and helps you catch UI bugs, perform visual regression testing, and collaborate with team members on component changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;While Git submodules offer a straightforward approach to code sharing, it's important to note that this approach may not be suitable for every scenario. Like any other tools and platforms, it has its own set of advantages and disadvantages. Therefore, it is crucial to thoroughly research and evaluate your specific needs before deciding on the best option for your project.&lt;/p&gt;

&lt;p&gt;Consider factors such as the complexity of your codebase, the scale of your projects, the level of collaboration required, and the desired level of control over dependencies. Additionally, take into account the learning curve, maintenance overhead, and compatibility with your existing development workflow.&lt;/p&gt;

&lt;p&gt;You can find the examples of this tutorial here:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mitevskasara" rel="noopener noreferrer"&gt;
        mitevskasara
      &lt;/a&gt; / &lt;a href="https://github.com/mitevskasara/library" rel="noopener noreferrer"&gt;
        library
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Library of cross-application UI components
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;LibraryUI - Cross-Application Components&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Welcome to the &lt;code&gt;library&lt;/code&gt; repository! This repository is part of an example in my blog post &lt;a href="https://formfusion.dev/blog/2023/05/sharing-react-components-across" rel="nofollow noopener noreferrer"&gt;Share React Components Across Projects with Git Submodules&lt;/a&gt; showcasing how to share code between different Git repositories. It specifically contains the implementation of a reusable &lt;code&gt;Button&lt;/code&gt; component that is used across multiple projects.&lt;/p&gt;

&lt;p&gt;The main goal of this repository is to provide an example of how Git submodules can be leveraged to share React components (or other pieces of code) across multiple repositories, ensuring reusability and consistency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Demo&lt;/strong&gt;: &lt;a href="https://library-smitevskas-projects.vercel.app/" rel="nofollow noopener noreferrer"&gt;https://library-smitevskas-projects.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Table of Contents&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#overview" rel="noopener noreferrer"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#usage" rel="noopener noreferrer"&gt;Usage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#installation" rel="noopener noreferrer"&gt;Installation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#component-details" rel="noopener noreferrer"&gt;Component Details&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#repositories-using-this-library" rel="noopener noreferrer"&gt;Repositories Using This Library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#development" rel="noopener noreferrer"&gt;Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#contributing" rel="noopener noreferrer"&gt;Contributing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mitevskasara/library#license" rel="noopener noreferrer"&gt;License&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Overview&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;This repository hosts the source code for a customizable &lt;code&gt;Button&lt;/code&gt; component, written in React, which is used by multiple projects. The button is designed to be easily styled and configured according to the needs of different applications.&lt;/p&gt;

&lt;p&gt;This repository uses &lt;strong&gt;Parcel&lt;/strong&gt; as its build…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mitevskasara/library" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;

&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mitevskasara" rel="noopener noreferrer"&gt;
        mitevskasara
      &lt;/a&gt; / &lt;a href="https://github.com/mitevskasara/first-app" rel="noopener noreferrer"&gt;
        first-app
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Created with StackBlitz ⚡️
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;React + Vite&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.&lt;/p&gt;

&lt;p&gt;Currently, two official plugins are available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md" rel="noopener noreferrer"&gt;@vitejs/plugin-react&lt;/a&gt; uses &lt;a href="https://babeljs.io/" rel="nofollow noopener noreferrer"&gt;Babel&lt;/a&gt; for Fast Refresh&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/vitejs/vite-plugin-react-swc" rel="noopener noreferrer"&gt;@vitejs/plugin-react-swc&lt;/a&gt; uses &lt;a href="https://swc.rs/" rel="nofollow noopener noreferrer"&gt;SWC&lt;/a&gt; for Fast Refresh&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mitevskasara/first-app" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;

&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mitevskasara" rel="noopener noreferrer"&gt;
        mitevskasara
      &lt;/a&gt; / &lt;a href="https://github.com/mitevskasara/second-app" rel="noopener noreferrer"&gt;
        second-app
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;second-app&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;This repository is part of an Example of code-sharing between different Git repositories.
It uses a shared Button component from &lt;a href="https://github.com/mitevskasara/library" rel="noopener noreferrer"&gt;https://github.com/mitevskasara/library&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mitevskasara/second-app" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
