Usage
Vertical separator with label:
<.split_pane
id="sidebar-splitter"
label="Sidebar"
orientation="vertical"
default_size={30}
>
<:primary>One</:primary>
<:secondary>Two</:secondary>
</.split_pane>
Vertical separator with visible label:
<.split_pane id="sidebar-splitter"
labelledby="sidebar-label"
orientation="vertical"
default_size={30}
>
<:primary>
<h2 id="sidebar-label">Sidebar</h2>
<p>One</p>
</:primary>
<:secondary>Two</:secondary>
</.split_pane>
Nested window splitters:
<.split_pane
id="sidebar-splitter"
label="Sidebar"
orientation="vertical"
default_size={30}
>
<:primary>One</:primary>
<:secondary>
<.split_pane
id="filter-splitter"
label="Filters"
orientation="horizontal"
default_size={50}
>
<:primary>Two</:primary>
<:secondary>Three</:secondary>
</.split_pane>
</:secondary>
</.split_pane>
The size of the primary pane is written to the --split-pane-position
custom property on the outer element as a percentage. Your stylesheet must
apply that property to the layout.
A split pane with a horizontal separator needs a height of its own, or both
panes stay at the size of their content.
Keyboard
Left and Right - move a vertical separator by one percent.
Up and Down - move a horizontal separator by one percent.
Shift + arrow key - move by ten percent.
Home and End - the smallest and the largest size.
Enter - collapse the primary pane, or restore the size it had before.
The size is the hook's own state and it survives a LiveView patch, so
default_size applies on the first render only.