CSS :user-valid / :user-invalid Playground

The batik class sign-up sheet as a real form: type, Kirim and Reset, then the browser answers when :invalid, :user-invalid and :user-valid match, and Rara is…

Why it matters

A form that is red before anyone fills it in makes people hesitate and leave. Getting the timing right used to need a "touched" state in JavaScript (Formik, React Hook Form). Now the browser keeps the "touched" mark itself, and the rules still come from the HTML (required, type, minlength, pattern).

The key idea

The same validity rules, only the moment differs

Common mistakes

Try it in this playground