MCPcopy Create free account
hub / github.com/reactstrap/reactstrap / Example

Function Example

stories/examples/Accordion/AccordionFlushExample.js:9–55  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

7} from 'reactstrap';
8
9function 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&#39;s accordion body.</strong>
26 You can modify any of this with custom CSS or overriding our default
27 variables. It&#39;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&#39;s accordion body.</strong>
36 You can modify any of this with custom CSS or overriding our default
37 variables. It&#39;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&#39;s accordion body.</strong>
46 You can modify any of this with custom CSS or overriding our default
47 variables. It&#39;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
57export default Example;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…