A Custom Accordion using React Components

A Custom Accordion using React Components

Component Brief: The first item of the accordion should be open by default. The active item should also close automatically if another item is selected. Instead of hardcoding the content, it would be great if the app included JSON formatted data.

Custom React Accordion

accordion screenshot

Component Brief: The first item of the accordion should be open by default. The active item should also close automatically if another item is selected. Instead of hardcoding the content, it would be great if the app included JSON formatted data.

Extra points The accordion should meet a high standard of accessibility, and the opening and closing be controlled using keyboard input (the up and down arrows).


I adapted this answer on CSS transitions based on state for the panel.

Download Details:

Author: peteraiello

Demo: https://custom-react-accordion.herokuapp.com/

Source Code: https://github.com/peteraiello/custom-react-accordion

react reactjs javascript

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

What is ReactJS? | ReactJS Basics | Learn ReactJS | React for Beginners | ReactJS Training

This Edureka video on "What is ReactJS ?" will help you understand the fundamentals of ReactJS and help you in building a strong foundation in React by understanding the advantages of ReactJS along with its features and major aspects.

Increase Performance of React Applications Via Array JavaScript Methods

Increase Performance of React Applications Via Array JavaScript Methods. We will create a simple event management application in the react to add, update, and delete an event.

Routing in React without React-Router

I have been using React JS in my projects for quite some time now and am used to managing routing in my app using the react-router package. I have always been keen on having as little dependencies in my apps as possible, so, I always felt perturbed by the use of this particular package in simpler apps which did not have complex routes.

The Ugly Side of React Hooks

In this post, I will share my own point of view about React Hooks, and as the title of this post implies, I am not a big fan.