JSFiddle - React, Tailwind, and code Playground

HTML

<form>
  <input required type="text" pattern="0|[1-9]\d*">
  <input type="submit">
</form>