(props)
| 7 | } from 'reactstrap'; |
| 8 | |
| 9 | function Example(props) { |
| 10 | const [open, setOpen] = useState(''); |
| 11 | const toggle = (id) => { |
| 12 | if (open === id) { |
| 13 | setOpen(''); |
| 14 | } else { |
| 15 | setOpen(id); |
| 16 | } |
| 17 | }; |
| 18 | |
| 19 | return ( |
| 20 | <div> |
| 21 | <Accordion flush open={open} toggle={toggle}> |
| 22 | <AccordionItem> |
| 23 | <AccordionHeader targetId="1">Accordion Item 1</AccordionHeader> |
| 24 | <AccordionBody accordionId="1"> |
| 25 | <strong>This is the first item's accordion body.</strong> |
| 26 | You can modify any of this with custom CSS or overriding our default |
| 27 | variables. It's also worth noting that just about any HTML can |
| 28 | go within the <code>.accordion-body</code>, though the transition |
| 29 | does limit overflow. |
| 30 | </AccordionBody> |
| 31 | </AccordionItem> |
| 32 | <AccordionItem> |
| 33 | <AccordionHeader targetId="2">Accordion Item 2</AccordionHeader> |
| 34 | <AccordionBody accordionId="2"> |
| 35 | <strong>This is the second item's accordion body.</strong> |
| 36 | You can modify any of this with custom CSS or overriding our default |
| 37 | variables. It's also worth noting that just about any HTML can |
| 38 | go within the <code>.accordion-body</code>, though the transition |
| 39 | does limit overflow. |
| 40 | </AccordionBody> |
| 41 | </AccordionItem> |
| 42 | <AccordionItem> |
| 43 | <AccordionHeader targetId="3">Accordion Item 3</AccordionHeader> |
| 44 | <AccordionBody accordionId="3"> |
| 45 | <strong>This is the third item's accordion body.</strong> |
| 46 | You can modify any of this with custom CSS or overriding our default |
| 47 | variables. It's also worth noting that just about any HTML can |
| 48 | go within the <code>.accordion-body</code>, though the transition |
| 49 | does limit overflow. |
| 50 | </AccordionBody> |
| 51 | </AccordionItem> |
| 52 | </Accordion> |
| 53 | </div> |
| 54 | ); |
| 55 | } |
| 56 | |
| 57 | export default Example; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…