Check out example codes for "html legend fieldset". It will help you in understanding the concepts better.

Code Example 1

<form action="/action_page.php">
  <fieldset>
    
    <legend>Personalia:</legend>
    <label for="fname">First 
    name:</label>
    <input type="text" id="fname" name="fname"><br><br>
    
    <label for="lname">Last name:</label>
    <input 
    type="text" id="lname" name="lname"><br><br>
    <label 
    for="email">Email:</label>
    <input type="email" 
    id="email" name="email"><br><br>
    <label 
    for="birthday">Birthday:</label>
    <input type="date" 
    id="birthday" name="birthday"><br><br>
    <input 
    type="submit" value="Submit">
  </fieldset>
</form>

Learn ReactJs, React Native from akashmittal.com