JSFiddle - React, Tailwind, and code Playground

HTML

<h2>Form validation</h2>
<form>
  <label>
    Mandatory input <input type="text" name="first-name" required />
  </label>
  <button type="submit">Submit</button>
</form>