Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

FAQ Accordion Challenge

P
Aleji0309•150
@Aleji0309
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

I'm most proud of how clean and responsive the accordion component turned out. I managed to keep the code organized and accessible while ensuring smooth toggle transitions and a mobile-first layout. It felt great to build a component that works well across different screen sizes with minimal bugs.

What I would do differently next time Next time, I’d focus more on accessibility from the beginning — for example, incorporating ARIA attributes and enabling full keyboard navigation. I’d also like to explore writing the logic using a framework like React to practice component-based architecture and state management.

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

One of the main challenges was managing the toggle logic while keeping the layout from breaking when multiple answers were opened. Initially, I had trouble ensuring only one FAQ could be open at a time. I solved it by resetting all items before toggling the clicked one. It also took some trial and error to get the transitions smooth without breaking the layout, but using max-height and overflow tricks did the job.

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

I'd love feedback on improving accessibility — especially how to properly use ARIA roles and keyboard interactions for better user experience. I'm also open to suggestions on how to simplify or refactor the toggle logic to make the code more scalable and maintainable in larger projects.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Aleji0309'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

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

Frontend Mentor

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

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