Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(accordion): add
flush
support and stayOpen
support
- Loading branch information
Showing
18 changed files
with
207 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { useState } from 'react'; | ||
import { Accordion, AccordionBody, AccordionHeader, AccordionItem } from 'reactstrap'; | ||
|
||
const Example = (props) => { | ||
const [open, setOpen] = useState(); | ||
const toggle = (id) => { | ||
open === id ? setOpen() : setOpen(id); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Accordion flush open={open} toggle={toggle}> | ||
<AccordionItem> | ||
<AccordionHeader targetId="1"> | ||
Accordion Item 1 | ||
</AccordionHeader> | ||
<AccordionBody accordionId="1"> | ||
<strong>This is the first item's accordion body.</strong> | ||
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 <code>.accordion-body</code>, though the transition does limit overflow. | ||
</AccordionBody> | ||
</AccordionItem> | ||
<AccordionItem> | ||
<AccordionHeader targetId="2"> | ||
Accordion Item 2 | ||
</AccordionHeader> | ||
<AccordionBody accordionId="2"> | ||
<strong>This is the second item's accordion body.</strong> | ||
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 <code>.accordion-body</code>, though the transition does limit overflow. | ||
</AccordionBody> | ||
</AccordionItem> | ||
<AccordionItem> | ||
<AccordionHeader targetId="3"> | ||
Accordion Item 3 | ||
</AccordionHeader> | ||
<AccordionBody accordionId="3"> | ||
<strong>This is the third item's accordion body.</strong> | ||
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 <code>.accordion-body</code>, though the transition does limit overflow. | ||
</AccordionBody> | ||
</AccordionItem> | ||
</Accordion> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Example; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { UncontrolledAccordion, AccordionBody, AccordionHeader, AccordionItem } from 'reactstrap'; | ||
|
||
const Example = (props) => { | ||
return ( | ||
<div> | ||
<UncontrolledAccordion defaultOpen={['1', '2']} stayOpen> | ||
<AccordionItem> | ||
<AccordionHeader targetId="1"> | ||
Accordion Item 1 | ||
</AccordionHeader> | ||
<AccordionBody accordionId="1"> | ||
<strong>This is the first item's accordion body.</strong> | ||
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 <code>.accordion-body</code>, though the transition does limit overflow. | ||
</AccordionBody> | ||
</AccordionItem> | ||
<AccordionItem> | ||
<AccordionHeader targetId="2"> | ||
Accordion Item 2 | ||
</AccordionHeader> | ||
<AccordionBody accordionId="2"> | ||
<strong>This is the second item's accordion body.</strong> | ||
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 <code>.accordion-body</code>, though the transition does limit overflow. | ||
</AccordionBody> | ||
</AccordionItem> | ||
<AccordionItem> | ||
<AccordionHeader targetId="3"> | ||
Accordion Item 3 | ||
</AccordionHeader> | ||
<AccordionBody accordionId="3"> | ||
<strong>This is the third item's accordion body.</strong> | ||
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 <code>.accordion-body</code>, though the transition does limit overflow. | ||
</AccordionBody> | ||
</AccordionItem> | ||
</UncontrolledAccordion> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Example; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.