johnwalley / allotment

A React component for resizable split views
https://allotment.mulberryhousesoftware.com/
MIT License
979 stars 55 forks source link

Collapsible/Expandable panel #426

Open Taifunov opened 2 years ago

Taifunov commented 2 years ago

It will be great to add here some resizer arrow, as it was done in react-split-pane, and have the possibility to collapse or expand this panel. Something like this image

horacioh commented 2 years ago

what I do is to use the Pane components and change the visible prop on them. this will collapse/expand them (the button needs to be outside the pane tho)

johnwalley commented 1 year ago

Hi @Taifunov. Sorry for taking forever to respond!

I really appreciate the screenshot. I do see the use-case.

I'm currently sticking quite close to VS Code so I don't have any plans to implement this, but I do see the utility.

I'll take a closer look at react-split-pane too.

volodymyrdn commented 1 year ago

Hi @Taifunov. I made it by putting a button into a Pane, and by clicking it sets the desired sizes of all panes with resize() method of Allotment. (see https://github.com/johnwalley/allotment#programmatic-control)

bboure commented 12 months ago

I'm also interested in something like this.

My use case is the same as the Sidebar sections in VSCode. I'd like to have several vertical sections that I can collapse.

CleanShot 2023-11-01 at 16 52 13

I am not sure this is achievable with the current solution. To be honest, I am not sure this should be the purpose of this component either.

thoughts?