I want to create nested accordion. In order to do that, I append to the children of my main accordion multiple accordions, in the following manner:
output = dmc.Accordion( , id=‘Accordion_rawData’ , value=‘data’)
output2 = dmc.Accordion([…))
I do get my nested accordion, but when user expanded first accordion and click second accordion. First accordion is closed. When I changed dmc.Accordion to dmc.AccordionMultiple it worked, but this is not what I want ( all the items stay open).
Any ideas on how can I do it?
if you are using dash-mantine-components, you can use this component now for the problem you are facing.
dmc.AccordionMultiple. This component allows for multiple accordians to open and collapse simultaneously.
You can also look at dash-bootstrap-components and it also has a Accordian Component, that has the attribute
always_open=True. check this URL
Thanks for your response.
The AccordionMultiple indeed allows me to open all the nested accordions, but I don’t want them to stay open when I click them. So for example, if I have this shell:
If I’m clicking on the first accordion, and then on the second accordion, I want the first accordion to close.
Regarding the dbc.Accordion component, unfortunately I cant use it because it doesn’t have features that I need ( ring process etc’ )
@MaayanShoshan, this might be interesting:
Hey all, I needed a reactive file explorer that generated a file tree given a path, so here it is. Big thanks to
@AnnMarieW for help building this out!
[Screen Recording 2022-10-08 at 5.09.47 PM]
Here is the code:
from dash_iconify import DashIconify
import dash_mantine_components as dmc
def __init__(self, filepath: os.PathLike):
Usage: component = FileTree('Path/to/my/File').render()
self.filepath = filepath