Split Layout

The SplitLayout component divides a container into two resizable sections, separated by a draggable handlebar. Users can adjust the width of the left and right sections dynamically by dragging the handlebar.

SplitLayout with breakpoint

SplitLayout with breakpoint will break the horizontal layout into a vertical layout when the screen is too small.

By default, the SplitLayout will take the height full screen, this examples sets this manually using the style property.

Left Content
Right Content
Expand/Collapse source code
Copied
Copy source sections
Copy source as is
SSR/CSR
Can be used both on the server and on the client side.
Imports
import live-web.dom
import live-web-view.layout
Styles
static any[] use = [SplitLayout]
Content
SplitLayout{ style = { height: '15rem' }
    panes: [
        SplitPane{
            CenterLayout{
                T`Left Content`
            }
        },
        SplitPane{
            CenterLayout{
                T`Right Content`
            }
        }
    ]
}

Horizontal SplitLayout

By setting breakPoint to false, we disable the breakpoint behavior, and keep the horizontal layout:

Left Content
Right Content
Expand/Collapse source code
Copied
Copy source sections
Copy source as is
SSR/CSR
Can be used both on the server and on the client side.
Imports
import live-web.dom
import live-web-view.layout
Styles
static any[] use = [SplitLayout]
Content
SplitLayout{ style = { height: '15rem' } breakPoint: false
    panes: [
        SplitPane{
            CenterLayout{
                T`Left Content`
            }
        },
        SplitPane{
            CenterLayout{
                T`Right Content`
            }
        }
    ]
}

Vertical SplitLayout

We can also set vertical to true to set the layout to vertical always:

Left Content
Right Content
Expand/Collapse source code
Copied
Copy source sections
Copy source as is
SSR/CSR
Can be used both on the server and on the client side.
Imports
import live-web.dom
import live-web-view.layout
Styles
static any[] use = [SplitLayout]
Content
SplitLayout{ style = { height: '15rem' } vertical: true
    panes: [
        SplitPane{
            CenterLayout{
                T`Left Content`
            }
        },
        SplitPane{
            CenterLayout{
                T`Right Content`
            }
        }
    ]
}