Skip to content

Natata08/rating-component

Repository files navigation

Frontend Mentor - Interactive rating component solution

This is a solution to the Interactive rating component challenge on Frontend Mentor.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Select and submit a number rating
  • See the "Thank you" card state after submitting a rating
  • See animated transition between states

Screenshot

Desktop View

Desktop View Desktop View

Mobile View

Mobile View Mobile View

Links

My process

Built with

  • React - JS library
  • Vite - Build tool
  • Framer Motion - Animation library
  • CSS Modules
  • Mobile-first workflow
  • Semantic HTML5
  • CSS Custom Properties
  • Flexbox

What I learned

  • Implementing mobile-first responsive design:
.card {
  /* Mobile styles first */
  padding: var(--spacing-16);

  /* Tablet and up */
  @media (min-width: 768px) {
    padding: var(--spacing-32);
  }
}
  • Adding animations with Framer Motion:
<AnimatePresence mode='wait'>
  <motion.div
    variants={cardVariants}
    initial='initial'
    animate='animate'
    exit='exit'
  >
    {/* Card content */}
  </motion.div>
</AnimatePresence>

About

Interactive rating component build with React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published