Ipywidget accordion is expanded by default when the notebook is executed for the first time. How to make the accordion collapsed by default ?
Thanks in Advance.
Set selected_index = None
when creating the Accordion.
from ipywidgets import Accordion, FloatSlider
acc = Accordion(children=[FloatSlider()], selected_index=None)
display(acc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With