import React, { useState } from 'react' import { CCard, CCardBody, CCardHeader, CCol, CRow, CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, } from '@coreui/react' import { Example } from 'src/reusable' const Accordion = () => { const [activeKey, setActiveKey] = useState(0) const [activeKey2, setActiveKey2] = useState(0) return ( React Accordion

Click the accordions below to expand/collapse the accordion content.

(activeKey === 1 ? setActiveKey(0) : setActiveKey(1))} > Accordion Item #1 This is the first item's accordion body. 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 .accordion-body, though the transition does limit overflow. (activeKey === 2 ? setActiveKey(0) : setActiveKey(2))} > Accordion Item #2 This is the second item's accordion body. 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 .accordion-body, though the transition does limit overflow. (activeKey === 3 ? setActiveKey(0) : setActiveKey(3))} > Accordion Item #3 This is the third item's accordion body. 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 .accordion-body, though the transition does limit overflow.
React Accordion Flush

Add flush to remove the default background-color, some borders, and some rounded corners to render accordions edge-to-edge with their parent container.

(activeKey2 === 1 ? setActiveKey2(0) : setActiveKey2(1))} > Accordion Item #1 This is the first item's accordion body. 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 .accordion-body, though the transition does limit overflow. (activeKey2 === 2 ? setActiveKey2(0) : setActiveKey2(2))} > Accordion Item #2 This is the second item's accordion body. 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 .accordion-body, though the transition does limit overflow. (activeKey2 === 3 ? setActiveKey2(0) : setActiveKey2(3))} > Accordion Item #3 This is the third item's accordion body. 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 .accordion-body, though the transition does limit overflow.
) } export default Accordion