lotusui the ikaito design language for Gio — desktop, mobile, web
GitHub

Field

Label, helper, error and required — around any control.

Field is the form-field wrapper: it adds the label above, helper or error text below, and the required marker — around any control (Input, Select, Checkbox, a custom widget). The control knows nothing about it; composition, not slots.

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 field

Usage

Go
lotusui.Field(th, lotusui.FieldOpts{Label: "Email"}, func(gtx C) D {
	return email.LayoutField(th, gtx, "you@example.com")
})

Helper text

Helper renders muted guidance under the control.

Go
lotusui.FieldOpts{Label: "Email", Helper: "We'll never share it."}

Required

Required marks the label; validation stays yours.

Go
lotusui.FieldOpts{Label: "Email", Required: true}

Error

Error replaces the helper with the message in danger ink — pair it with the control's own invalid chrome.

Go
lotusui.FieldOpts{Label: "Workspace name", Error: msg}

Any control

The wrapped control is any layout.Widget — here a Select.

Go
lotusui.Field(th, lotusui.FieldOpts{Label: "Role"}, func(gtx C) D {
	return role.Layout(th, gtx, "")
})

API

OptionTypeDescription
LabelstringThe label above the control.
HelperstringMuted guidance below; recomputed each frame (counters).
ErrorstringReplaces Helper in danger ink.
RequiredboolMarks the label.

Every demo on this site is the real Go component compiled to WebAssembly — one gallery app, one bundle, addressed by URL hash.