Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 2 years ago

Interactive-Pricing-Component using Tailwind CSS

tailwind-css, react
Koya•310
@koyaboy
A solution to the Interactive pricing component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hello community,

I hope you're all doing well. While working on this project, I've come across a couple of challenges that I'd appreciate some help with.

  • Icon Slider Alignment:

In my App.jsx, I've been struggling with aligning the icon-slider in the center of the range-slider-thumb. The related code section is currently commented out in my App.jsx, as shown below:

<div className="relative w-full mb-12 flex justify-center md:order-3 mt-10">
  <input
    type="range"
    min="0"
    max="100"
    step="25"
    value={sliderValue}
    onChange={(e) => setSliderValue(e.target.value)}
    className="range-slider"
    style={{ background: sliderGradient }}
  />

  {/* <img
    src={iconSlider}
    alt="icon-slider"
    className="absolute -top-0.5 -translate-x-1/2"
    style={{
      left: `${sliderValue}%`,
      transform: `translate(${sliderValue === 0 ? '50%' :
        sliderValue === 25 ? '0%' :
        sliderValue === 50 ? '-50%' :
        sliderValue === 75 ? '-100%' :
        sliderValue === 100 ? '-150%' :
        '0'
      })`,
    }}
  /> */}
</div>

I've tried a few techniques, but I couldn't achieve the desired alignment. If anyone has insights or suggestions on how to achieve this, I'd be really grateful.

  • Responsive Design and Chrome Dev Tools:

While I've implemented responsive design in my site, I've noticed an issue when using Chrome Dev Tools to simulate specific devices like the iPhone XR and Samsung Galaxy.

The content gets clipped, and scrolling doesn't work as expected. I've experimented with the overflow property, but haven't found a solution yet. I'm wondering what I did wrong. I would appreciate it if anyone can help me out with this.

Any help or guidance you can provide on these two challenges would be greatly appreciated. Thank you in advance for your assistance!

Best regards, Koya

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Koya's solution.

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.