How to transform basic forms into interactive experiences? These 20 CSS form effects include floating labels, focus animations, real-time visual validation and custom inputs. Each component is accessible and works on all modern browsers.

Floating Label

The label floats upward when the input is focused or filled.

CSS Focus Transform

Underline Focus

Animated line that extends from the center on focus.

CSS Focus Gradient

Border Animation

Border that draws itself progressively around the input.

CSS Focus Border
Invalid email

Shake Validation

The input shakes to indicate a validation error.

JS Animation Validation

Success Checkmark

Animated checkmark that appears when the input is valid.

JS SVG Validation
Password strength

Password Strength

Animated password strength indicator.

JS Animation Security

Search Expand

Search field that expands on click.

CSS Focus Transform

Input with Icon

Icon that animates on input focus.

CSS Focus Icon
0 / 200

Textarea Auto-grow

Text area that auto-grows.

JS Resize Interactive

Submit Button States

Button with animated loading, success and error states.

JS Animation States

Floating Label V2

Label that elegantly floats above the input with colored background.

CSS Focus Transform

Underline Animation

Line that extends from the center on focus.

CSS Focus Pseudo-element

Glow Input

Input with glow effect on focus.

CSS Box-shadow Focus

Checkbox Animated

Checkbox with animated checkmark that appears progressively.

CSS Transform Checkbox
Notifications

Toggle iOS Style

Toggle switch with elastic iOS-style animation.

CSS Cubic-bezier Toggle

Radio Ripple

Radio buttons with ripple effect on selection.

CSS Animation Radio

Password Strength V2

Compact strength indicator with colored bar.

JS Animation Security

Select Animated

Dropdown with animated arrow on focus.

CSS Transform Select
0 / 150

Character Counter

Textarea with built-in character counter.

JS Counter Textarea

Search Expand V2

Compact search field that expands on focus.

CSS Focus Width

Frequently Asked Questions

How to create a floating label in CSS? +

Place the label after the input in the HTML. Use the :placeholder-shown selector to detect if the input is empty, and the :focus selector for the active state. Animate the label position and size with transform and transition.

How to style form validation in CSS? +

Use the :valid and :invalid pseudo-classes to change input styles based on their state. Add a green or red border with a smooth transition. Combine with :not(:placeholder-shown) to only validate filled fields.

Are animated forms accessible? +

Yes, as long as you keep labels associated with inputs (for/id attribute), maintain sufficient contrast, and do not hide error messages behind animations. Always test with a screen reader.

How to animate input focus? +

Use the :focus-within selector on the container and :focus on the input. Animate the border, add a colored box-shadow, or reveal an animated line with a ::after pseudo-element and a width transition.

What is the best framework for animated forms? +

For simple forms, pure CSS is enough with the :focus, :valid, :invalid selectors. For complex forms, combine with vanilla JavaScript for real-time validation. No framework needed — Effect.Labs provides ready-to-use CSS code.