Skip to content
  • Unlock Pro
  • Log in with GitHub
Profile
OverviewSolutions
8
Comments
3
Justin Levy
@justinsane

All solutions

  • Interactive Rating Component - React & Tailwind

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    Am I using React state correctly in this example?

    function App() {
      const [rating, setRating] = useState(null);
      const [submitted, setSubmitted] = useState(false);
    
      const handleSubmit = (e) => {
        e.preventDefault();
        if (rating !== null) {
          setSubmitted(true);
        }
      };
    
    function Rating({ setRating, handleSubmit, rating }) {
      const handleRating = (value) => {
        setRating(value);
      };
    

    1 comment
  • Product Preview Card - React & Tailwind CSS

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    Ways or tips to simplify the design process for both small and large screens.


    2 comments
  • Results Summary (React & Tailwind CSS)

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    Is there a better way to dynamically style color using Tailwind CSS? See my challenge above.


    0 comments
  • FAQ Accordion (React and Tailwind CSS)

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    I'm curious if the keyboard focus solution that I implemented is reasonable. Is there a simpler or cleaner way?

    function AccordionItem({ title, text }) {
      const [isOpen, setIsOpen] = useState(false);
      const headerRef = useRef(null);
    
      function handleToggle() {
        setIsOpen(prevIsOpen => !prevIsOpen);
      }
    
      const handleKeyDown = event => {
        if (event.key === 'Enter' || event.key === ' ') {
          handleToggle();
        } else if (event.key === 'ArrowDown') {
          const nextSibling = headerRef.current.parentElement.nextElementSibling;
          if (nextSibling) {
            nextSibling.querySelector('.accordion-header').focus();
          }
        } else if (event.key === 'ArrowUp') {
          const previousSibling =
            headerRef.current.parentElement.previousElementSibling;
          if (previousSibling) {
            previousSibling.querySelector('.accordion-header').focus();
          }
        }
      };
      return (
        
          
            {title}
            
          
          
            {text}
          
        
      );
    }
    

    0 comments
  • Blog Preview Card (React and Tailwind)


    Justin Levy•100
    Submitted about 1 year ago

    I could use more help translating the Figma design to css, specifically how to use 'rem' and the association with Tailwind classes.


    2 comments
  • Social Links Profile (React and Tailwind CSS)

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    Can I improve this by using React useState hook for the hover function or is CSS hover properties sufficient?

    Eg-

    a:hover {
      @apply bg-green text-black;
    }
    

    2 comments
  • Recipe Page (React and Tailwind CSS)

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    I'd like help using Tailwind CSS to properly align the decimal ordered list items in the 'Instructions' section.

    function Instructions() {
      return (
        
          Instructions
          
            
              Beat the eggs: In a bowl,
              beat the eggs with a pinch of salt and pepper until they are well
              mixed. You can add a tablespoon of water or milk for a fluffier
              texture.
            
            
              Heat the pan: Place a
              non-stick frying pan over medium heat and add butter or oil.
            
            
              Cook the omelette: Once
              the butter is melted and bubbling, pour in the eggs. Tilt the pan to
              ensure the eggs evenly coat the surface.
            
            
              Add fillings (optional):{' '}
              When the eggs begin to set at the edges but are still slightly runny
              in the middle, sprinkle your chosen fillings over one half of the
              omelette.
            
            
              Fold and serve: As the
              omelette continues to cook, carefully lift one edge and fold it over
              the fillings. Let it cook for another minute, then slide it onto a
              plate.
            
            
              Enjoy: Serve hot, with
              additional salt and pepper if needed.
            
          
          
        
      );
    }
    

    and custom css:

    .custom-ordered-list li::marker {
      @apply text-nutmeg font-bold;
    }
    
    .custom-ordered-list {
      counter-reset: item;
      list-style: none;
      padding-left: 0;
    }
    
    .custom-ordered-list li {
      position: relative;
      padding-left: 2.25rem;
      margin-bottom: 0.9rem;
    }
    
    .custom-ordered-list li::before {
      content: counter(item) '.';
      counter-increment: item;
      position: absolute;
      left: 0;
      top: 0;
      font-weight: bold;
      color: #8b4513;
    }
    
    .custom-ordered-list .bold-span {
      display: inline-block;
      width: rem;
    }
    

    0 comments
  • QR Code Component - React and Tailwind

    #react#tailwind-css

    Justin Levy•100
    Submitted about 1 year ago

    I could use help with the paragraph text. It doesn't match the original image. I was instructed per the project style-guide.md that paragrah text is font-size 15 px.


    0 comments

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

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

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

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

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

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

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

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

Oops! 😬

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

Log in with GitHub