Form validation states

Error, success and required styling driven by CSS selectors.

The platform already knows whether a field is valid — `:user-invalid` fires only after somebody has actually interacted, which is the difference between helpful and hostile. These lean on that rather than on a class the framework toggles, so an empty form does not light up red before the user has typed anything.

34 matching34 effectsFree to copy

Paired valid / invalid fields with inline messages, glyphs and matching focus rings in ocean.

Red summary block counting the form errors above the fields themselves, where hovering one of the listed messages rings the field it belongs to and reddens its label.

Password field with a four-segment ocean strength meter that fills left to right.

Dial code chosen inside the field it prefixes rather than in a separate control, with the valid state marked at the trailing edge where the eye finishes the line.

Custom checkbox that springs a white tick into a blue box, with a real focus ring.

Radio group whose selected dot pops into a blue ring — no JavaScript, pure :checked.

Native select with the OS arrow stripped and an ocean chevron that nudges down on hover.

Dashed upload target that tints ocean and spins its plus badge when you hover it.

Six-box verification code field with an ocean caret and a lift on the focused digit.

Immutable prefix and input sharing one bordered wrapper, so the focus ring surrounds the whole control instead of half of it.

Whole card is the label, so the entire row is a hit target, with the tick scaled from zero rather than toggled on `display`.

Field and its meta bar joined into one control by removing the shared border, both taking the focus color so they light as a unit.

Value that reads as text until hovered, when a border and a pencil appear — the settings pattern that avoids a separate edit mode.

Chips, a typeahead and an option list in one control, the menu opening on `:focus-within` so it survives tabbing into the field.

Payment entry as one joined control — number above, expiry and CVC sharing the row below — with the detected brand mark sitting inside the field it applies to.

Repeatable row group where every entry carries its own remove control and the add affordance is dashed, marking it as the one row that is not yet data.

Signing surface with a dashed baseline and cross mark, the stroke revealed left to right by an animated inset clip so it draws rather than fades in.

Text field whose placeholder label shrinks and floats to the top edge on focus or when a value is entered.

Radio group styled as a segmented pill control where the checked option gets a filled, glowing thumb.

Number input flanked by minus and plus caps that fill with the accent when hovered.

Borderless field with a thin bottom rule where an accent underline grows outward from the centre on focus.

Radio group of colour swatch dots where the checked swatch grows an offset ring and a tick.

Text field that holds removable tag chips inline, with the chip close buttons and the field border reacting on hover and focus.

Address field with a suggestion list hanging below it, each row giving the street on one line and the locality on the next.

Showing 24 of 34. Search the rest →

Questions about form validation states

Why `:user-invalid` and not `:invalid`?
`:invalid` matches on first paint, so every required field is red before the form is touched. `:user-invalid` waits until the field has been edited and blurred, which is when a person expects to be told.
Is a red border enough to signal an error?
No. Pair it with text describing the problem, connect that text with `aria-describedby`, and set `aria-invalid` — colour alone fails both colour-blind users and anyone not looking at the field.
Are these form validation states free to use?
All 34 are free to copy and use in your own projects, including commercial ones. A Pro licence exists for redistribution — shipping them inside a product other people buy — and the full terms are on the licence page.
How do I add one to my project?
Copy the CSS and the markup from the artifact's page — there is nothing to install, no runtime and no build step. The CLI (`npx hoverlab add`) is there for the component tiers above these, where a file gets written rather than pasted.