Split
The carousel of panes — content is revealed and hidden, never reflowed.
Split arranges a screen's main panes as a carousel. All panes live on
one horizontal strip behind an overflow-hidden viewport; the screen's depth decides what shows.
Two eased values drive every transition — pane 0's width fraction and the strip's X
translation. Panes are only ever revealed or hidden by the viewport's edges;
content never re-flows mid-animation.
Installation
Use the module import (the default), or own the source: lotusui add
vendors the component into your app and lotusui update keeps the copy mergeable —
see Registry.
go get github.com/ikaito-com/lotusui
# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add split
Usage
Pass every pane the screen can show — including currently hidden ones — so
mid-animation frames render content sliding, never popping. Build each pane with
SplitBox so appearing and disappearing panes look identical.
LayoutSolo is the full-width pivot: two panes, one visible at a time.
var s lotusui.Split
s.Layout(gtx, th.Space.MD, depth,
lotusui.SplitBox(th, listPane),
lotusui.SplitBox(th, detailPane),
lotusui.SplitBox(th, editorPane),
)
VSlide
VSlide is Split's vertical sibling for full-screen pivots: the
over-screen slides up from the bottom while the base screen is pushed up and away. Settled, only
the visible screen is laid out; mid-flight, recorded frames are merely translated — verbatim
pixels sliding, so moving content can never reflow, compress, or flicker.
var v lotusui.VSlide
v.Layout(gtx, th, expanded, baseScreen, overScreen)
API
| Option | Type | Description |
|---|---|---|
gap | unit.Dp | Layout parameter — spacing between the strip's panes. |
depth | int | Which panes the viewport shows: 0 = pane 0 full width; n = panes n-1 and n side by side. |
boxes | ...layout.Widget | Every pane the screen can show, hidden ones included, so mid-animation frames slide instead of pop. |