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

Responsive and accessible accordeon widget

P
BillRozy 170

@BillRozy

Desktop design screenshot for the FAQ accordion coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am glad it is very similar to design

What challenges did you encounter, and how did you overcome them?

no challenges in this one

What specific areas of your project would you like help with?

no

Community feedback

@filipjuszczak

Posted

Hi!

For the "FAQ" abbreviation, you might want to use abbr tag with the title attribute to explain the abbreviation to the user (a tooltip is shown when user hovers on it):

<h1 className="font-bold text-[2rem] leading-[38px] desktop:text-[3.5rem] desktop:leading-[65.7px] text-purple-dark">
  <abbr title="Frequently Asked Questions">
    FAQs
  </abbr>
</h1>

You could use the details and summary tags to create the accordion. You wouldn't need to implement open/close functionality, as it's already in place. It would look something like that:

export default function Accordeon({
  topic,
  content,
  open,
  onOpenChange,
}: AccordeonProps) {
  return (
    <details open={open}>
      <summary>{topic}</summary>
      <p>{content}</p>
    </details>
  );
}

Great job!

Marked as helpful

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