Forms
Joseph
·
7:52
·
18K views
·
About this lesson
We’ve looked at how to add a simple focus effect for an input on the properties — but that’s just scratching the surface. Let’s take a look at how we can take input states and validation to the next level using components.
We’ll have an input with a placeholder as the default state…
Then when we click, we’ll enter a focused state — and the label will move up above the input….
Then after we type something and click away, we want to have a defocus, or “blur” state, where the styling is like the default state — but the label remains up and above the input….
Then finally, we want an invalid state in case what’s typed in the input is not a valid email address — But also to re-validate the text once it’s fixed.
Let’s build it.
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=0s Intro
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=5s What we’re building: input states and validation
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=16s Setting up the form and default state styling
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=27s Adjusting layout and label positioning
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=46s Creating the focus variant
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=62s Adding blur and invalid variants
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=78s Styling borders for smooth animations
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=94s Adding focus interactions
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=109s Why we need a blur state
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=140s Handling empty vs filled blur logic
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=170s Adding validation for invalid input
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=205s Fixing the invalid state with revalidation
https://www.youtube.com/watch?v=qN9giCMK6Zo&t=258s Wrap up
🌞 Start for free: https://framer.link/yt
📚 Learn more at: https://framer.link/yt-academy
💎 Join the Community: https://framer.link/yt-community
🎉 Follow on X: https://framer.link/yt-x