Skip to content
Learn Netverks

Lesson

Step 20/36 56% through track

validation-states

Validation states

Last reviewed Jun 1, 2026 Content v20260601
Track mode
iframe_html
Means
HTML preview sandbox
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Validation states—the ideas, syntax, and habits you need before moving on in Pico CSS.

Class-light frameworks teach when semantic HTML alone should carry the design.

You will apply Validation states in contexts like: Documentation sites, blogs, internal tools, and side projects where you want polish without a large class vocabulary.

Read the lesson, edit HTML/CSS in the playground, press Run to preview, then answer the lesson MCQs.

When the previous lesson's MCQs feel easy and you can explain Validation states in your own words.

Pico surfaces valid and invalid fields with aria-invalid—set to "true" or "false" after your validation runs. Matching <small> helper text below the control inherits success or error colors.

Server vs client validation

Pico does not run validators. In production, set aria-invalid from server-side errors or accessible client-side logic after submit or blur. Pair errors with visible text—never rely on border color alone.

Native constraints

HTML5 attributes like required, minlength, and pattern still matter; Pico styles the control once the browser or your script marks the field invalid. Compare with Bootstrap validation classes, which use is-invalid on wrappers instead of ARIA on the input.

Important interview questions and answers

  1. Q: How does Pico show errors without utility classes?
    A: aria-invalid="true" on the control triggers Pico’s invalid border and icon treatment; helper small text picks up the error color.
  2. Q: Does Pico replace HTML5 validation?
    A: No—it styles outcomes; you still validate on the server and expose readable error messages.

Self-check

  1. Which attribute toggles Pico’s invalid styling?
  2. Where should the human-readable error message live?

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • aria-invalid used?
  • Errors not color-only?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump