JSFiddle - React, Tailwind, and code Playground

HTML

<input type="number" min="0" max="18" step="0.5" pattern="\d+" />