Panels can be conditionally rendered. The order
ensures they are (re)added in the correct order.
If an autoSaveId
is provided, layouts will be stored separately for each panel combination.
1 <PanelGroup autoSaveId="conditional" direction="horizontal">
2 {showLeftPanel && (
3 <>
4 <Panel id="left" order={1}>
5 left
6 </Panel>
7 <PanelResizeHandle />
8 </>
9 )}
10 <Panel id="center" order={2}>
11 middle
12 </Panel>
13 {showRightPanel && (
14 <>
15 <PanelResizeHandle />
16 <Panel id="right" order={3}>
17 right
18 </Panel>
19 </>
20 )}
21 </PanelGroup>