This is a simple accordion project built using React's useState
hook. The accordion allows you to expand and collapse sections by clicking on the +
and -
icons.
- Expand and collapse sections
- Uses
useState
hook for managing state - Icons change between
+
and-
based on the state
-
Clone the repository:
git clone https://github.com/Piyushchannawar/React-Mini-Projects.git cd Accordion
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5173
.
Click on the +
icon to expand a section and reveal its content. Click on the -
icon to collapse the section and hide its content.
It is very commonly used in website to answer common questions.