title: How to use bootstrap accordion code in react
body: <p>I just copied the code of bootstrap accordion from bootstrap components <a href="https://getbootstrap.com/docs/5.0/components/accordion/" rel="nofollow noreferrer">https://getbootstrap.com/docs/5.0/components/accordion/</a> ,</p>
  <p>Expected that there will be a dropdown but it is not there
  Do not want to use the react bootstrap component  <a href="https://react-bootstrap.netlify.app/components/accordion/" rel="nofollow noreferrer">https://react-bootstrap.netlify.app/components/accordion/</a></p>
  <pre><code>import React from &quot;react&quot;;
  
  export default function about(){
   
  
    return (
      &lt;div className=&quot;container&quot;&gt;
        &lt;div className=&quot;accordion&quot; id=&quot;accordionPanelsStayOpenExample&quot;&gt;
    &lt;div className=&quot;accordion-item&quot;&gt;
      &lt;h2 className=&quot;accordion-header&quot; id=&quot;panelsStayOpen-headingOne&quot;&gt;
        &lt;button className=&quot;accordion-button&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#panelsStayOpen-collapseOne&quot; aria-expanded=&quot;true&quot; aria-controls=&quot;panelsStayOpen-collapseOne&quot;&gt;
          Accordion Item #1
        &lt;/button&gt;
      &lt;/h2&gt;
      &lt;div id=&quot;panelsStayOpen-collapseOne&quot; className=&quot;accordion-collapse collapse show&quot; aria-labelledby=&quot;panelsStayOpen-headingOne&quot;&gt;
        &lt;div className=&quot;accordion-body&quot;&gt;
          &lt;strong&gt;This is the first item's accordion body.&lt;/strong&gt; It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the &lt;code&gt;.accordion-body&lt;/code&gt;, though the transition does limit overflow.
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div className=&quot;accordion-item&quot;&gt;
      &lt;h2 className=&quot;accordion-header&quot; id=&quot;panelsStayOpen-headingTwo&quot;&gt;
        &lt;button className=&quot;accordion-button collapsed&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#panelsStayOpen-collapseTwo&quot; aria-expanded=&quot;false&quot; aria-controls=&quot;panelsStayOpen-collapseTwo&quot;&gt;
          Accordion Item #2
        &lt;/button&gt;
      &lt;/h2&gt;
      &lt;div id=&quot;panelsStayOpen-collapseTwo&quot; className=&quot;accordion-collapse collapse&quot; aria-labelledby=&quot;panelsStayOpen-headingTwo&quot;&gt;
        &lt;div className=&quot;accordion-body&quot;&gt;
          &lt;strong&gt;This is the second item's accordion body.&lt;/strong&gt; It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the &lt;code&gt;.accordion-body&lt;/code&gt;, though the transition does limit overflow.
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div className=&quot;accordion-item&quot;&gt;
      &lt;h2 className=&quot;accordion-header&quot; id=&quot;panelsStayOpen-headingThree&quot;&gt;
        &lt;button className=&quot;accordion-button collapsed&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#panelsStayOpen-collapseThree&quot; aria-expanded=&quot;false&quot; aria-controls=&quot;panelsStayOpen-collapseThree&quot;&gt;
          Accordion Item #3
        &lt;/button&gt;
      &lt;/h2&gt;
      &lt;div id=&quot;panelsStayOpen-collapseThree&quot; className=&quot;accordion-collapse collapse&quot; aria-labelledby=&quot;panelsStayOpen-headingThree&quot;&gt;
        &lt;div className=&quot;accordion-body&quot;&gt;
          &lt;strong&gt;This is the third item's accordion body.&lt;/strong&gt; It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the &lt;code&gt;.accordion-body&lt;/code&gt;, though the transition does limit overflow.
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
      &lt;/div&gt;  
      
      
      
    );
  }
  </code></pre>
  <p>I also imported <code>import 'bootstrap/dist/css/bootstrap.min.css';</code> in app.js</p>
  <p>but on rendering only the top accordion is showing cannot drop down other accordion.
  Noob at react :)</p>