Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Made in react and tailwind

Jimmy Wu 180

@jameswu49

Desktop design screenshot for the Interactive pricing component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I wasn't able to figure out how to make the slider for this project. At the moment, it will move when dragged, but doesn't follow the cursor and goes off the bar itself. Would appreciate any guidance on how to best approach this!

Community feedback

Alex Li 400

@awexli

Posted

Hey Jimmy, took a peep at your code. It looks like you're doing a lot just for a slider, fortunately there's an easier way :-)

HTML has a built-in input tag just for this, via <input type="range" /> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range

If you'd like to save the values of the input to be used later, you'll probably want to save them to React's state onChange. Some resources to help you out:

Marked as helpful

1

Jimmy Wu 180

@jameswu49

Posted

@awexli I came to the same solution after checking out other's solutions! Glad I was on the right track :). Thanks for the feedback and resources!

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord