Sidebar

The SidebarLayout component is used to create a responsive sidebar.

Sidebar Content

Main 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.content
import live-web-view.layout
Styles
static any[] use = [SidebarLayout, Content]
Content
SidebarLayout{
    Sidebar{
        SidebarCompact{
            SidebarCloseButton{}
        }
        Header{
            H1`Sidebar Content`
        }
    }
    Aside{
        SidebarCompact{
            SidebarToggleButton{}
        }
        Content{
            H1`Main content`
        }
    }
}

Use the direction property SidebarLayout.Direction.Left or SidebarLayout.Direction.Right to position the layout left or right.

Sidebar Content

Main 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.content
import live-web-view.layout
Styles
static any[] use = [SidebarLayout, Content]
Content
SidebarLayout{ direction: SidebarLayout.Direction.Right
    Sidebar{ position: Sidebar.Position.Parent
        SidebarCompact{
            SidebarCloseButton{}
        }
        Header{
            H1`Sidebar Content`
        }
    }
    Aside{
        SidebarCompact{
            SidebarToggleButton{}
        }
        Content{
            H1`Main content`
        }
    }
}