lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
GitHub

Grid

The 2D layout primitive: equal tracks, spans, and stepped columns.

Grid lays items into equal-width tracks with row-major auto-flow — each item takes the first slot wide and deep enough for its spans. Fixed Columns, or stepped Cols: Cols(1).At("md", 2).At("lg", 4) against Theme breakpoints. Row heights derive from content; spanning items stretch.

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
go get github.com/ikaito-com/lotusui

# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add grid

Col span

open demo ↗

Spanning rows and columns

open demo ↗

Responsive columns

When Cols is set it wins over Columns. Resize — track count follows Theme breakpoints (defaults: md=768, lg=992).

open demo ↗

API

OptionTypeDescription
ColumnsintFixed track count when Cols unset (min 1).
ColsResponsiveIntStepped columns; Cols(n).At("md", 2). When Set(), overrides Columns.
Gap / RowGap / ColGapunit.DpSpacing; Gap covers both axes unless overridden.
GapsResponsiveDpStepped gap for both axes when Set().
GridItem.ColSpan / .RowSpanintTracks the item spans; zero means 1. Cell(w) and Span(cols, w) are shorthands.
GridItem.ColSpans / .RowSpansResponsiveIntStepped spans when Set().
Layout(th, gtx, items…)methodNeeds Theme for breakpoint resolve.

lotusui is a Go design system for native desktop and mobile — and the web when you want it. Docs demos are the real components (WebAssembly) — one gallery app, each Preview an iframe addressed by URL hash.