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

Input

The single-line input: three variants, seven sizes, composable everything else.

A single-line editor in themed chrome. Structure (labels, buttons, adornments) is COMPOSITION — nil-able Start/End slots and the Field wrapper; behavior (filters, transforms) is caller-owned functions. A file input is a native picker on the web — out of scope for a canvas UI, use your platform's file dialog ("from the web").

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 input

Usage

open demo ↗

Disabled

Read-only, dimmed, no caret.

open demo ↗

With label

Wrap any control in Field for the label.

open demo ↗

With button

An input beside a button is ordinary composition — a Flex row.

open demo ↗

Variants

InputOutline (default), InputSubtle (filled, border on focus), InputFlushed (underline only).

open demo ↗

Sizes

All seven shared Size presets — text and padding move together.

open demo ↗

Start and End elements

Widgets INSIDE the field, beside the editor — an icon, a clear ✕, a visibility eye. nil costs nothing.

open demo ↗

Suffix addon

A fixed suffix rendered as part of the field's chrome.

open demo ↗

Invalid

Error switches the chrome to danger and renders the message.

open demo ↗

Field — label, helper, required

The full wrapper is its own component — see Field for helper text, required markers and error slots around any control.

open demo ↗

Filter and Transform

Generic mechanisms for the app's rules: Filter is an allow-list, Transform a same-frame rewrite (here: fold to lowercase).

open demo ↗

Clear button — composed

A clear button is just an End widget; the core knows nothing about it.

open demo ↗

Character counter — composed

Cap length with Transform; the counter is Field.Helper, recomputed each frame.

open demo ↗

Grid

Inputs side by side are a Flex row — each field takes an equal share.

open demo ↗

With badge

The label row is yours to compose — here a Beta badge beside the label.

open demo ↗

Field group

Stacked Fields in a Card read as one form section.

open demo ↗

Text addons

Muted text segments in the frame — a currency pair, a URL scheme and TLD — are Start/End widgets.

open demo ↗

Kbd

Kbd renders the keyboard-cap hint — compose it as the End slot.

open demo ↗

Spinner

open demo ↗

Inline button

A small icon button inside the frame — the copy-URL field.

open demo ↗

Block addons

Top/Bottom render full-width rows INSIDE the frame, above/below the editor line.

open demo ↗

API

OptionTypeDescription
VariantInputVariantInputOutline (default), InputSubtle, InputFlushed.
SizeSizeThe shared size presets (Size2XS–Size2XL).
FilterstringAllow-list of runes; empty accepts everything.
Transformfunc(string) stringSame-frame rewrite — folds, caps, masks.
ErrorstringDanger chrome + message below the field.
DisabledboolRead-only, dimmed, no caret.
Start / Endlayout.WidgetWidgets inside the field, beside the editor; nil costs nothing.
Editorwidget.EditorThe underlying Gio editor — its own Mask (password dots), InputHint (mobile keyboard), MaxLen and selection API are yours to set directly.
Top / Bottomlayout.WidgetFull-width rows inside the frame — the block addons.
Kbd(th, key)widgetThe keyboard-cap hint, for End slots and prose.

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.